You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Learn/Jb09_SwitchDemo.java

46 lines
710 B

public class Jb09_SwitchDemo
{
public static void main(String[] args)
{
// ѡ<><D1A1><EFBFBD><EFBFBD><E1B9B9>Switch
/*
switch (<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ)
{
case ȡֵ1:
ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
break;
case ȡֵ2:
ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2;
break;
......
default:
ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
break;
}
*/
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD><D6A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD>
int month = 3;
switch (month)
{
case 3:
case 4:
case 5:
System.out.println("<22>Ǵ<EFBFBD><C7B4><EFBFBD>");
break;
default:
System.out.println(<>ж<EFBFBD>Ӧ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>");
break; //<2F>˴<EFBFBD>break<61><6B>ʡ<EFBFBD><CAA1>
}
/*
if<EFBFBD><EFBFBD>switch<EFBFBD><EFBFBD>Ӧ<EFBFBD>ó<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if:
1<EFBFBD><EFBFBD><EFBFBD>Ծ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>
2<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>
3<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E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