Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Contoh Penggunaan Kondisional If, If else, dan If else-if

Langsung saja berikut Contoh Penggunaan Kondisional if, if else, dan if else-if :




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...


This post first appeared on Bow's, please read the originial post: here

Share the post

Contoh Penggunaan Kondisional If, If else, dan If else-if

×

Subscribe to Bow's

Get updates delivered right to your inbox!

Thank you for your subscription

×