VB.net 2010 视频教程 VB.net 2010 视频教程 python基础视频教程
SQL Server 2008 视频教程 c#入门经典教程 Visual Basic从门到精通视频教程
当前位置:
首页 > 编程开发 > Java教程 >
  • java学习一

java学习一

 
1
2
3
4
5
6
7
8
9
10
11
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);
    }
}
//定义

  

 

1
2
3
4
5
6
7
8
9
10
11
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);
    }
}
//运算

  

 

1
2
3
4
5
6
7
8
9
10
11
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语句
复制代码

 出  处:https://www.cnblogs.com/leiziv5/p/7890827.html



相关教程