×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Vasilii Vasilev
Added: May 2, 2014 9:28 AM
Views: 13
Tags: no tags
if, else if
  1. int a = 1;        
  2. if (a ==1) {
  3.    System.out.println("One");            
  4. }else if (a == 2){
  5.     System.out.println("two");
  6. }else if (a == 3){
  7.     System.out.println("three");
  8. }else{
  9.     System.out.println("invalid");
  10. }
  11.