What is love? This is my result:
public class Love {
String love;
public static void main(String[] args) {
System.out.println("What is Love:");
String yourResult = new Scanner(System.in).nextLine();
loveTest(yourResult);
}
public static String loveTest(String love) {
try {
if (love.equals("heart")) {
System.out.println("Then Do you know his heart?");
} else if (love.equals("money")) {
System.out.println("Then How much his love?");
} else if (love.equals("happiness")) {
System.out.println("Then You are happy,really?");
} else if (love.equals("pain")) {
System.out.println("Then Why do you want love?");
} else if (love.equals("sex")) {
System.out.println("Then What did you get finally?");
} else {
System.out.println("Then What is love?");
}
} catch (Exception e) {
System.out.println("Sorry,Exception happend! Maybe God forget you...");
} finally {
love = null;
System.out.print("Maybe you are right,but Love is Nothing!");
}
return love;
}
}
聯(lián)系客服