?? eraserthreaddemo.java
字號:
package threaddemo;
import java.util.Scanner;
import thread.eraserthread.EraserThread;
public class EraserThreadDemo {
/**
* @param args
*/
public static void main(String[] args) {
Scanner scanner=new Scanner(System.in);
while(true){
System.out.print("輸入名稱:");
String name=scanner.next();
System.out.print("輸入密碼:");
EraserThread eraserThread=new EraserThread('#');
eraserThread.start();
String password=scanner.next();
eraserThread.setActive(false);
if("lizengguang".equals(name)&&"123456".equals(password)){
System.out.print("歡迎進入系統");
break;
}
else{
System.out.printf("%s,名稱或密碼有錯誤,請重新輸入!%n",name);
}
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -