📄 eraser.java
字号:
package runnable;
public class Eraser implements Runnable{
private boolean active;
private String mask;
public Eraser(){
this('*');
}
public Eraser(char maskChar){
active=true;
mask="\010"+maskChar;
}
public void setActive(boolean active){
this.active=active;
}
public boolean isActive(){
return active;
}
public void run(){
while(isActive()){
System.out.print(mask);
try{
Thread.currentThread().sleep(50);
}
catch(InterruptedException e){
e.printStackTrace();
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -