Home Help Java C Case Java Keyword
Questions:Ask|Latest


 
 

Share on Google+Share on Google+

Case Java Keyword

Advertisement
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;
}
Advertisement

Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: March 22, 2005

Ask Questions?    Discuss: Case Java Keyword  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
DMCA.com