public class hello {
/**
*
*
*
*
* @param args
*/
public static void main(String[] args) {
String _$dd123 ="";//定义变量
int i;
i=123;//分号要注意是英文分号
int m=1,n=2,x=4,y=5;//最好分开写
final double PAI = 3.14; //常量赋值一次,后面不能更改,常量名一般全大写
//pai = 3.1415926;i=ddd;这样都会报错,常量不能更改
String strUserName ="tom住在这个房间";
System.out.println(strUserName);
strUserName ="张三住在这个房间";
System.out.println(strUserName);
byte b =127;//范围-128至127
short s = 2;
int j = 123;
long l = 1234L;//后面标记L确定为long型
int c = (int)1234l;//强制转换,显示转换
long ll = b;
float f = 123.45f;//需要在数字末尾加“f”标记
double d =12345;
f = (float)d;//强制转换,必须是相关数据类型才可以转换
f = l;
char v ='a';//单引号‘’引起来你的单个字符
int a = v;
System.out.println("a =" +a);
char g = 98;
System.out.println("g =" +g);
boolean t = true; //逻辑真,true和false都是小写
t = false;//逻辑假
// TODO 自动生成的方法存根