Java. Io套件 string name= console. readline("[s]","输入名称."); char[] passwd= console. readpassword("[s]","输人密码… string password new string (passwd)i if( caterpillar.equals(name)&& 123456 .equals(password))i System. out. print1n("欢迎 caterpl1lar"); break else System.out. printf("s,名称或密码错误’请重新输入!器n",name);java.io套件 String name = console.readLine("[%s] ","输入名称…"); char[] passwd = console.readPassword("[%s]","输入密码…"); String password = new String(passwd); if("caterpillar".equals(name) && "123456".equals(password)) { System.out.println("欢迎caterpillar "); break; } else { System.out.printf("%s,名称或密码错误,请重新输入!%n", name); }