explain compound statement in java.
Answers
Answered by
2
A compound statement is any number and kind of statements grouped together within curly braces. You can use a compound statement anywhere a statement is required by Java
Answered by
2
Heya user ,
Here is your answer !!
A set of statements ( more than 1 ) written in if-else conditional statements within second brackets ( { } ) is called a compound statement .
Example :--
if ( a > 10 )
{
b ++ ;
c - - ;
}
else
{
b - - ;
c ++ ;
}
The statements written within the curly brackets in the above example are called compound statements .
Hope it helps !!
Here is your answer !!
A set of statements ( more than 1 ) written in if-else conditional statements within second brackets ( { } ) is called a compound statement .
Example :--
if ( a > 10 )
{
b ++ ;
c - - ;
}
else
{
b - - ;
c ++ ;
}
The statements written within the curly brackets in the above example are called compound statements .
Hope it helps !!
Similar questions