public class Beijing { public static void main (String arge []) { int age=23;//定义int类型 long c=2323232;//定义长整型 char beij='汉'; System.out.print(beij); boolean beijing=false;//定义boolen System.out.println(beijing); } } //定义
public class Dingyi { public static void main( String args[]) { short a=0; int i=11; long l=22; double d=555; float m=1.9f; System.out.println(i/m*d/l); } } //运算
public class Iftest { public static void main( String args[]) { int i=2; if (i> 1 && i< 11){ System.out.println("i是位于1和11"); }else { System.out.println("i不是位于1和11之间"); } } } //if语句
public class Switchjava { public static void main(String args[]) { char c='1'; switch (c) { case 'b': System.out.println('n'); break; case 'a': System.out.println('b'); break; default: System.out.println('d'); } } } //switch语句