JAVA基础

 关键字(。。。。) 标识符的规则:1 不能是关键字或true,false,null  2:标识符可以包含字母,数字,下划线或美元符号$,但不能以数字开头。 3:标识符区分大小写  ( 见名知意  驼峰命名规则  帕斯卡命名法 ) 数据类型  基本类型: int char byte long float double short boolean

 

接收输入:
import java.util.Scanner;
  public class Input{
      public static void main (String[] args){
            Scanner input=new Scanner(System.in);
            int num=input.nextInt();
           // double d=input.nextDouble();
          // String s=input.next();
                }
   }; 

0——99的随机数;
   int random=(int)(Math.random()*100);

常量 
final 数据类型 常量名=常量值
(常量名要求全大写)

posted @ 2015-03-29 19:22  JG22李洋  阅读(117)  评论(0)    收藏  举报