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
Social Sciences,
7 months ago
Chemistry,
7 months ago
Math,
7 months ago
Math,
1 year ago
English,
1 year ago