I have tried it the way shown below but when i enter username as OMBHAYDE it prints welcome mr ombhayde along with sorry and when i type username as VIJAYBHAYDE it says welcome mr om bhayde instead vijay bhayde. Pls help.
String name1 = "OMBHAYDE";
int key1 = 15062003;
String name2 = "VIJAYBHAYDE";
int key2 = 17081967;
Scanner sc = new Scanner(System.in);
System.out.println("Username-");
String username = sc.nextLine();
System.out.println("Password-");
int password = sc.nextInt();
if (username == name1 && password == key1 );
System.out.println("Welcome Mr.Om Bhayde");
if (username == name2 && password == key2)
System.out.println("Welcome Mr.Vijay Bhayde");
else
System.out.println("Sorry");