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?
