Question
why am i getting this error: error: cannot find symbol if((username==user_name) && (password == hashed_password)) ^ symbol: variable password location: class cooperbooks 2 errors cooperbooks.java:119:
why am i getting this error:
error: cannot find symbol if((username==user_name) && (password == hashed_password)) ^ symbol: variable password location: class cooperbooks 2 errors cooperbooks.java:119: error: cannot find symbol if((username==user_name) && (password == hashed_password)) ^ symbol: variable username location: class cooperbooks cooperbooks.java:119: error: cannot find symbol if((username==user_name) && (password == hashed_password)) ^ symbol: variable password location: class cooperbooks
here is my code
while(result.next()) { user_name = result.getString(1); if (result.wasNull()) { user_name = null; } //if
hashed_password = result.getString(2);
if (result.wasNull()) { hashed_password= null; } // if
// Enter your user name and password String username = new String(); String password= new String(); System.out.println("Enter Username"); username=input.nextLine(); System.out.println ("Enter password"); password= input.nextLine(); // if statement to check if the user name and password is valid } if((username==user_name) && (password == hashed_password)) { System.out.println("Log is invalid"); // System.out.println(" do want to be a member, Yes or No ?"); // decision=input.nextLine();
} else { System.out.println("Welcome Member"); //System.out.println("Select option"); //displayMenu(); } // while }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started