Implementasi else-if pada java :
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package elseif;
/**
* Joko Fani Andrianto
* www.andre-networking.blogspot.com
* @author root
*/
public class ElseIF {
public static void main(String[] args) {
int nilai1=10;
if (nilai1==10){
System.out.println("Nilainya sepuluh");
}
else {
System.out.println("Bukan sepuluh");
}
}
}
Hasil Program :
Tulis komentar anda... Conversion Conversion Emoticon Emoticon