English

Explain the usage of the following special symbol in Java: ()(simple brackets)

Advertisements

Question

Explain the usage of the following special symbol in Java:

()(simple brackets)

Explain
Advertisements

Solution

The simple brackets or parentheses () are used in Java to enclose conditions, expressions, and parameters. They are used in conditional statements such as if and while, and in method declarations and method calls. Parentheses are also used to control the order of evaluation in arithmetic expressions by giving priority to the operations enclosed within them.

Example:

if (a > b) 
{
    System.out.println("a is greater");
}
shaalaa.com
  Is there an error in this question or solution?
Chapter 6: Variables and Expressions - EXERCISE [Page 135]

APPEARS IN

Dheeraj Mehrotra Computer Science [English] Class 12
Chapter 6 Variables and Expressions
EXERCISE | Q 60. (d) | Page 135
Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×