I am making a decoder for a cipher called the Caesar Shift Cipher. I am making a first build of it and it will not be efficent at all so please ignore that. Here is my code so far:
Code:
if (shift == 1)
while (counter > 0) {
System.out.println("Enter a letter");
String letter = number.next();
if (letter == "a")
System.out.println("z");
else if (letter == "b")
System.out.println("a");
I thought this would work but whenever I run it it does not print out the new letter. I have no previous work with stings and I would really appriciate any information.