Switch syntax The code is as follows:Copy code Switch (expression){Case constant expression 1: Statement 1;....Case constant expression 2: Statement 2;Default: statement;} Default is to execute it if there is no matching case. default is not
http://m.blog.csdn.net/blog/tianyazaiheruan/8988420Today qnovations teacher in the use of switch, this design to the most basic content, may forget some of its basic grammar, there are some errors, so impromptu from a variety of data query summed up
The basic type, or built-in type, is a special type different from the class in Java. They are the most frequently used types in programming, so they are always indispensable in the interview questions, in this article, we will review the knowledge
Multiple choice structure switch statement
In java, a switch statement is provided for the multi-path Branch selection process. The switch statement selects one of the multiple operations to run based on the value of an expression. The syntax
A switch statement consists of a control expression and multiple case labels.The types supported by the switch control expressions are byte, short, char, int, enum (Java 5), String (Java 7).The Switch-case statement can be fully interoperable with
Java programming those things 34 -- switch statement syntax Zhengzhou game college Chen yuefeng from: http://blog.csdn.net/mailbomb
5.3.2 switch statementThe Chinese meaning of the switch keyword is the meaning of switch and conversion. The switch
The format of the switch statement: Switch (integer or character variable){The case variable may have a value of 1:Branch one;BreakThe case variable may have a value of 2:Branch two;BreakThe case variable may have a value of 3:Branch
casts of data types
public class example2{
int i=97;
Char c= (char) i; Cast of type
System.out.println ("c=" +c);
}
Hundred Record Entry dialog box
Import javax.swing.joptionpane;//dialog box to eject the method in the required package
public class
The fundamental difference between switch...case and If...else is that switch...case generates a jump table to indicate the address of the actual case branch, and the index number of the jump table is equal to the value of the switch variable. Thus,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.