Switch, break, continue, return statements
In previous post we discussed about control statements up to for loop. In this post we will come to know the remaining control statements like switch, break, continue, return statements with respective examples. If you don't have any idea about control statements in java, better follow this link to know about the Control Statement . Switch statement When there are several options and we have to choose only one option from the available ones, we can use switch statement. Depending on the selected option, a particular task can be performed. A task represents one or more statements. Syntax: switch(variable){ case value-1 : statement-1; case value-2 : statement-2; ...