DATA HOSTED WITH ♥ BY PASTEBIN.COM - DOWNLOAD RAW - SEE ORIGINAL
- import java.util.Scanner;
- public class Satu
- {
- public static void main(String[] args)
- {
- Scanner masukan = new Scanner(System.in);
- int pilihan=9;
- do
- {
- System.out.println("\nMENU\n");
- System.out.println("1. Membuat Objek String");
- System.out.println("2. Menggabungkan");
- System.out.println("3. Keluar");
- System.out.print("Masukkan Pilihan Anda : ");
- pilihan = masukan.nextInt();
- switch(pilihan)
- {
- case 1 : objek(); break;
- case 2 : gabung(); break;
- }
- } while(pilihan != 3);
- }
- private static void objek()
- {
- String str="Selamat Datang di Program Studi Teknik Informatika";
- System.out.println("Variabel Str : " + str);
- }
- private static void gabung()
- {
- String str;
- str="Selamat Datang "+" Mahasiswa Teknik Informatika";
- System.out.println(str);
- str +="\nITS";
- System.out.println(str);
- }
- }
0 comments:
Post a Comment