整型、浮点型、字符型相关知识
public static void main(String[] args) {
int a=10;
byte a2=11;
short a3=12;
long a4=13;
System.out.println(a);
System.out.println(a2);
System.out.println(a3);
System.out.println(a4);
System.out.println("-----------------------");
float b=10.2f;
float b2=10.1f;
double c=102/10;
System.out.println(b);
System.out.println(b2);
System.out.println(b==c);
System.out.println("-----------------------");
int w=02;
int w2=0x8;
int w3=0b10;
System.out.println(w);
System.out.println(w2);
System.out.println(w3);
System.out.println("-----------------------");
char ch='王';
String cha="c";
System.out.println((int)ch);
System.out.println("-----------------------");
System.out.println("你好,世界\nhello,world");
System.out.println("sss\taaa");
System.out.println("a\0ss");
System.out.println("zxc\bzxc");
System.out.println("-----------------------");
Integer e=new Integer(9);
Integer f=new Integer(9);
String g=new String("世界");
String h=new String("世界");
System.out.println(g==h);
String i="世界";
String j="世界";
System.out.println(i==j);
System.out.println("-----------------------");
boolean flag=true;
if(flag)
{
System.out.println("正确");
}
else
{
System.out.println("错误");
}
}
*如有不足之处,欢迎留言*