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

📄 thread8.java

📁 学习java编程的好程序
💻 JAVA
字号:
public class thread8
{
    public static void main(String[] args)
    {
        compute t=new compute('a');
        compute t1=new compute('b');
        t.start();
        t1.start();
    }
}
///创建一个线程类
///在这线程类中,使用循环语句输出字符
class compute extends Thread  
{
    char ch;
    compute(char ch)
    {
        this.ch=ch;
    }
    public void print(char ch)
    {
        for(int i=0;i<10;i++)
        {
            System.out.print(ch);
        }
    }
    public void run()
    {
    print(ch);
    System.out.println();
    }
}

⌨️ 快捷键说明

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