第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

不同于老師說(shuō)的結(jié)構(gòu),但實(shí)現(xiàn)同樣效果,不知道兩種方法有什么區(qū)別

每本書創(chuàng)建成單獨(dú)類調(diào)用

package com.xiaohongshu;


import java.util.Scanner;



public class Initail {


public static void main(String[] args) {

// TODO Auto-generated method stub

System.out.println("書庫(kù)中的圖書目錄:");

System.out.println("1.《紅樓夢(mèng)》");

System.out.println("2.《三國(guó)演義》");

System.out.println("3.《水滸傳》");

? ? ? ? System.out.println("4.《西游記》");

? ? ? ??

? ? ? ? while(true) {

? ? ? ? System.out.println("請(qǐng)輸入圖書的編號(hào)或名字:");

? ? ? ? Scanner input=new Scanner(System.in);

? ? ? ? String score=input.next();

? ? ? ? switch (score) {

case "1" :

case "紅樓夢(mèng)":

book hello=new HongLouMeng();

? ? ? ? hello.name();

? ? ? ? hello.category();

? ? ? ? hello.author();

? ? ? ? break;

case "2":

case "三國(guó)演義":

book hello2=new SanGuoYanYi();

? ? ? ? hello2.name();

? ? ? ? hello2.category();

? ? ? ? hello2.author();

? ? ? ? break;

case "3":

case "水滸傳":

book hello3=new ShuiHuZhuan();

? ? ? ? hello3.name();

? ? ? ? hello3.category();

? ? ? ? hello3.author();

? ? ? ? break;

case "4":

case "西游記":

book hello4=new SanGuoYanYi();

? ? ? ? hello4.name();

? ? ? ? hello4.category();

? ? ? ? hello4.author();

? ? ? ? break;


default:

System.out.println("輸入錯(cuò)誤,請(qǐng)重新輸入!");

continue;

}

? ? ? ?

//? ? ? ??

? ? ? ??

? ? ? ? }

}

}


正在回答

1 回答

當(dāng)書本數(shù)量很多的時(shí)候,一個(gè)個(gè)創(chuàng)建類就麻煩了

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

不同于老師說(shuō)的結(jié)構(gòu),但實(shí)現(xiàn)同樣效果,不知道兩種方法有什么區(qū)別

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)