Wednesday, April 3, 2013

contoh "switch-case"


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package praktikum1;

/**
 *
 * @author surur
 */
public class test1 {
         /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
       /**dani mau mengambil mata kuliah
        * yang dipilih adalah kalkulus
        */

       int makul=2;

        switch(makul){
            case 1:
                System.out.println("algo");break;
            case 2:
                System.out.println("kalkulus");break;
            case 3:
                System.out.println("teknik digital");break;
        }



    }

}

No comments:

Post a Comment