How do I get the correct response to print out?
import java.util.*;
import java.io.*;
public class MultipleChoiceTest {
public static void main (String[] args) {
Scanner input = new Scanner( System.in );
String Question;
String FirstName;
String LastName;
String Answer;
double CorrectTotal;
double IncorrectTotal;
double TotalQuestions;
double OverallTotal;
System.out.println("Please Enter First Name: ");
FirstName = input.next();
System.out.println("First Name: " + FirstName);
System.out.println("What code set is used for Inpatient Hospital Procedures? \nA). ICD-9-CM Vol. 3 \nB). HCPCS \nC). ICD-13 ");
System.out.println("Please Enter You Selection:");
Answer = input.next();
System.out.printf("Your Answer is: " + Answer );
if (Answer == "A")
{System.out.println("You Are Correct!");}
else
{System.out.println("You Are Incorrect");}
}
}
A Is the Right Answer, but it's not coming out like that:
Please Enter First Name:
asdf
First Name: asdf
What code set is used for Inpatient Hospital Procedures?
A). ICD-9-CM Vol. 3
B). HCPCS
C). ICD-13
Please Enter You Selection:
A
Your Answer is: AYou Are Incorrect