Here is the code-

import java.util.Scanner;

class Main {

public static void main(String[] args) {
String name;
String genInput;
Scanner sc = new Scanner(System.in);

System.out.println("What is your name?");
name = sc.nextLine();

System.out.println ("Are you sure your name is "+name+"? Y/N");
genInput = sc.nextLine();
if (genInput == "Y") { //the block thats supposed to react to you confirming your name
System.out.println("Test line A"); }

else if(genInput == "N") { //the block thats supposed to react to you denying your name is correct
System.out.println("Test line B"); }

else; {
System.out.println("Test line C"); } //the block that keeps playing back even when the input shouldnt make it (supposed to account for typos and whatnot)

}
}

When Y is put in, its supposed to print Test Line A, and when N is put in, its supposed to output Test Line B. However, no matter what you put in, it will skip down to the else statement and print Test Line C.

If the Else block is removed, it will print nothing, and if you make the else statement an else if != to Y or N then the same effect will happen and it will print out Test Line C. Im pretty sure it has something to do with the curly brackets being out of wack, but I cant figure out exactly where the issue is, since even if you leave the else if (B) and else (C) statements out, it wont print anything, so I figure the issue is at or before the Test Line A "if" statement.

Edit- Got it fixed now with .equals instead of ==. thanks to @Neddo and @sam! never would have even known .equals existed. preash.