public class SimpleTypes {
public static void main (String args [])
{
byte b=0x55;
short s=0x55ff;
int i=1000000;
char c='c';
float f=0.23f;
double d=0.7E-3;
boolean bool=true;
System.out.println("b="+b);
System.out.println("s="+s);
System.out.println("i="+i);
System.out.println("c="+c);
System.out.println("f="+f);
System.out.println("d="+d);
System.out.println("bool="+bool);
}
}
/**
* @算术运算符的运算
*/
public class suanshu{
public static void main (String args[])
{
int a=5+4;
int b=a*2;
int c=b/4;
int d=b-c;
int e=-d;
int f=e%4;
double g=18.4;
double h=g%4;
int i=3;
int j=i++;
int k=++i;
System.out.println("a="+a);
System.out.println("b="+b);
System.out.println("c="+c);
System.out.println("d="+d);
System.out.println("e="+e);
System.out.println("f="+f);
System.out.println("g="+g);
System.out.println("h="+h);
System.out.println("i="+i);
System.out.println("j="+j);
System.out.println("k="+k);
}
}