一句话:“看需求”。
look :[Java] 纯文本查看 复制代码 package com.itheima;
import java.util.ArrayList;
import java.util.Scanner;
public class Test03 {
public static void main(String[] args) {
ArrayList<String> list = new ArrayList<String>();
list.add("glad to meet you ♥ ,Convenient leave a contact way ?");
list.add("恭喜您!我们可以做朋友!");
Scanner sc = new Scanner(System.in);
System.out.println("请输入你的选择:");
String You = sc.nextLine();
switch(You){
case "danShenGuiZu" :
System.out.println(list.get(0));
break ;
case "tuoDan" :
System.out.println(list.get(1));
}
System.out.println("不管结果如何,这次谈话很愉快!May you succeed!");
}
}
|