public class SimpleIf { public static void main(String[] args) { boolean status = true; if(status) { System.out.println("Status is true"); } } }
public class SimpleIfElse { public static void main(String[] args) { boolean status = true; if(status) { System.out.println("Status is true"); }else{ System.out.println("Status is false"); } } }
public class SimpleIfElseIf { public static void main(String[] args) { int i = 11; if(i<10) { System.out.println("Kurang dari 10"); }else if(i>10) { System.out.println("Lebih dari 10"); }else { System.out.println("Sama dengan 10"); } } }
Selamat mencoba...
3 comments:
hehe,, ane masih newbie nih gan,, boleh dicoba nih.. :)
Thanks gan artikelnya
Very informative, keep posting such good articles, it really helps to know about things.
Posting Komentar