Menu



Manage

Cord > Study_JAVA 전체 다운로드
파일 목록
Study_JAVA > 12/SmartPhoneEx.java Lines 39 | 765 바이트
다운로드

                        package week12;

import java.util.Scanner;

public class SmartPhoneEx {
	public static void main(String[] args) {
		System.out.println("=== Music start use to Smart Phone===");
		
		Scanner sc = new Scanner(System.in);
		
		int menu;
		
		SmartPhone sp = new SmartPhone();
		EarP ep = null;
		
		while(true) {
			System.out.println("\n Please choose BT earphone if you want?(1.momentom 2.N5005 3.AONIC50 4.EXIT)");
			menu = sc.nextInt();
			
			if (menu == 4)
				break;
				
			switch(menu) {
			case 1:
				ep = new Momentom(); break;
			case 2:
				ep = new N5005(); break;
			case 3:
				ep = new AONIC50(); break;
			}
			sp.musicOn(ep);
			sp.musicoff(ep);
		}
		System.out.println("Program OFF");
		sc.close();
		
	}
}