Form Now On...

导航

 

一 基本数据结构

必须包括在类中

必须具备 public static main方法

大小写敏感

二、数据类型

四种整数类型:

Int 4字节 short 2字节 long8字节 byte1字节

二种浮点型

float 4字节

douleble 8字节

char类型;boolean类型

常量使用final定义 类常量使用static final定义

三、操作符号

X!=0 &&1/x>x+y   //如果X=0,不进行&&后面的计算避免x=0的1/x操作

数学操作符号Math.PI等

四、数值之间转换*

float f=9.98f;

Int i=(int)f;  //i=9

Int i=(int) Math.round(f);// i=10

String 比较使用equals

一、   数据读入

Scanner in = new Scanner(System.in);

String name = in.nextLine();

int age = in.nextInt();

posted on 2015-04-26 01:47  zjwei55  阅读(221)  评论(1编辑  收藏  举报