Home Help Java C Case Java Keyword



Case Java Keyword
Posted on: March 22, 2005 at 12:00 AM
The java keyword "case" is used to label each branch in the switch statement in java program.

Case Java Keyword

     

The java keyword "case" is used to label each branch in the switch statement in java program. In other word Case is a java keyword that will be defines group of statements that will begin executing in case a value specified matches value that defined through a preceding switch keyword.

In the java programming statement case block will not have the implicit ending point. At java statement every time break statement will typically be used at the end of each case block in java program. 

In statement case keyword having break statement, suspend the flow of execution in that particular case and then next  flow into all case and also in default blocks.

Syntact: Case Java Keyword

switch ()
{
case 1:
<statements>
break;
case 2:
<statements>
break;
default:
<statements>
break;
}

Related Tags for Case Java Keyword:


More Tutorials from this section

Ask Questions?    Discuss: Case Java Keyword  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.