Minggu, 25 Maret 2012



java 1.




package dayone;
public class RelationDemo {
public static void main(String[] args) {
int nilai1 = 10, nilai2 = 25;
int umur = 15;
double gaji = 1000d;
char huruf1 = 'd', huruf2 = 'f';



if (nilai1 > nilai2) {
System.out.format("%d is greater than %d %m",
nilai1, nilai2);
} else {
System.out.format("%d is greater than %d %n",
nilai2, nilai1);
}

if (umur >= 12) {
System.out.format("Hey, I am not a kid anymore %n");
}

if (huruf1 < huruf2) {
System.out.format("%c is less than %c %n",
huruf1, huruf2);
} else {
System.out.format("%c is less than %c %n",
huruf2, huruf1);
}

if (gaji <= 3000d) {
System.out.println("Entry-level Staff");
}
}
}

Selengkapnya...