The loop I'm trying to run will initialize but will not continue to run after the first loop. Since I know where the problem i took out most of the code to fix the loop. After i make the second selection the loop will not run. Thank you for any help.
public static void main(String[] args)
{
String number; // enter number
int stringLength = 0;
String selection = "y" ;
// Create a Scanner object to read input.
Scanner keyboard = new Scanner(System.in);
// PrintWriter outputFile = new PrintWriter("outDataFile.txt");
// outputFile.close();
while (selection == "y")
{
// Get the user's number.
System.out.print("Write your number ");
number = keyboard.nextLine();
System.out.print("y/Y to continue, any else to exit");
selection = keyboard.nextLine();
}
}