Computer Applications
Answer
Two or more statements can be grouped together by enclosing them between opening and closing curly braces. Such a group of statements is called a compound statement.
if (a < b) {
/*
* All statements within this set of braces
* form the compound statement
*/
System.out.println("a is less than b");
a = 10;
b = 20;
System.out.println("The value of a is " + a);
System.out.println("The value of b is " + b);
}
Related Questions
Write the syntax of 'if' statement.
Define the following:
(a) Normal flow of control
(b) Conditional flow of control
What are the different types of errors that take place during the execution of a program?
Write down the syntax of the following with reference to Java Programming:
(a) to accept an integer value using main( )
(b) to accept a fractional number using main( )