Before you jump at me saying this is already answered, yes I know its answered but all questions are different,on the answered questions they use code that i have still no knowledge therefore I cannot tell what im doing wrong. Anyways getting into my error I get an error saying can't initialize variable String admin2
, basically Im trying to make a password program, I know exactly what I need to change but I don't know what I have to do in order to make it work. Here is the error:
public static void main (String[] args){
Scanner input = new Scanner(System.in);
bacon baconObject = new bacon();
int password;
String admin;
String temp;
System.out.println("What is your username");
temp = input.nextLine();
System.out.println("What is your password ");
password = input.nextInt();
temp = admin;
if(temp == admin2 && password == 123){
System.out.println("Correct signing in......");
}else{
System.out.println("Incorrect!");
}
}
}