⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 synchronization1.java

📁 《Java编程基础、应用与实例》 源文件下载
💻 JAVA
字号:
class PrintThread extends Thread{
  char ch;
  public PrintThread(char ch){
  	this.ch=ch;
  }
  void printCh10(){
    for(int i=1;i<=10;i++)
  	   System.out.print(ch);
  }
  public void run(){
  	for(int i=1;i<=10;i++){
  	  printCh10();
  	  System.out.println();
    }
  }
}
public class Synchronization1{
  public static void main(String[] args) throws Exception{
     PrintThread pt=new PrintThread('A');
     pt.start();
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -