Skip to content

Instantly share code, notes, and snippets.

@old-repo-ekoteguh
Created March 28, 2014 02:43
Show Gist options
  • Save old-repo-ekoteguh/9824138 to your computer and use it in GitHub Desktop.
Save old-repo-ekoteguh/9824138 to your computer and use it in GitHub Desktop.
Here is simple example of using conditional If-else in Java programming
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.dekteguh.percabangan;
/**
*
* @author Eko Teguh Widodo
*/
public class PercabanganIfElse {
public static void main(String[] args) {
int i = 100;
//contoh percabangan if-else
if(i==10){
System.out.println("i bernilai 10");
}else{
System.out.println("i bukan bernilai 10");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment