All that is man
2009-11-15 23:22:59
import java.util.Scanner;
public class teh1337hax {
public static void main(String[] args){
/**Scanner s = new Scanner(System.in);
System.out.println("Please enter command: ");
String command = s.nextLine();
if(command == "login"){**/
if(login("Brian", "lolgf")){
System.out.println("W00tW00t u r t3h 1337 l0l");
}
//}
}
public static boolean login(String userName, String passWord){
Scanner s = new Scanner(System.in);
System.out.print("Please enter username: ");
String username = s.nextLine();
System.out.print("Please enter password: ");
String password = s.nextLine();
boolean tempbool = false;
if(username == userName){
if(password == passWord){
System.out.println("Login succesful");
tempbool = true;
}else{
System.out.println("Invalid password!");
tempbool = false;
}
}else{
System.out.println("Invalid username!");
}
return tempbool;
}
}
I cannot get scanner to work no matter what i type in, I was just messing around with java :p going to bed now will check in later