This java code is not printing what I want it to print.It is printing the last line "The above command is only acceptable "
import java.util.Scanner;
public class Recap1 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("Hi ! I am your dumb assistant, Dumbo");
System.out.println("Tell me your name");
String YourName = input.nextLine();
System.out.println("these are a list of commands which can tell me what to do :-");
String CurrentAffairs = "Tell me the current affairs";
String Dinner = "Cook my dinner" ;
String Marriage ="Will you marry me ?";
String Name = "What is my name ?";
String gift = "Buy me a gift";
System.out.println("Tell me the current affairs ");
System.out.println("Cook my dinner ");
System.out.println("Will you marry me ?");
System.out.println("What is my name ?");
System.out.println("Buy me a gift");
System.out.println("now write a command !!!");
String FirstCommand = input.nextLine();
if (FirstCommand == CurrentAffairs)
System.out.println("The Year is 2016" + "You are reading this" + "You are smiling " + "You are stupid");
else if
(FirstCommand == Dinner)
System.out.println("I can only cook roasted human brain covered with melted intestines sprinkled with blood sauce.I need the nearest human availible to me.Will you volunter? ");
else if
(FirstCommand == Marriage)
System.out.println("You are fine but I am afraid you are not of my type");
else if
(FirstCommand == Name)
System.out.println("Your name must be " + " " + YourName);
else if
(FirstCommand == gift)
System.out.println(" Give me some money and I will buy a gift for you.Deal ?");
else
System.out.println("Only the above commands are acceptable !!!!!!!!!!!!!!");
}
}