oic! Thank you very much!! :laugh:
kenna180
Posts
-
problem in do-while loop -
problem in do-while loopThe loop cant be stop eventho the key-in matches. Can anyone fix this and tell me my mistake? Greatly appreciate it if so!
import java.io.*; public class A { public static void main(String args[]) throws IOException { BufferedReader stdin=new BufferedReader (new InputStreamReader(System.in)); //char n,p; String name,pwd; int n1; int p2; System.out.println("\tWelcome to "); System.out.println("*******SHINE IT Training Centre*******"); System.out.println("**Please login before u calculate**"); do { System.out.println("Enter user name: "); name=stdin.readLine(); n1=Integer.parseInt(name); System.out.println("Enter password: "); pwd=stdin.readLine(); p2=Integer.parseInt(pwd); //System.out.println("Incorrect input!!"); } while ((name!="2208")&&(pwd!="1234")); System.out.println("Successful Login!!"); } }