1.多线程实例 package second; public class A implements Runnable { public char stat = '*'; public void run(){ for(int i = 1;i <= 10 ; i++){ for(int y=1;y<=i;y++){ System.out.print(stat); } System.out.println(); } } public static void main(String args[]){…
package second; public class A extends Thread { public void run(){ for(int i = 1;i <= 10 ; i++){ for(int y=1;y<=i;y++){ System.out.print("*"); } System.out.println(); } } public static void main(String args[]){ A a1 = new A(); A a2 = new A…
总结: 循环的使用率蛮高,Thraed.sleep(),try-catch语句 package com.aa; public class West { public static void main(String[] args) { try { for (int i = 0; i < 30; i++) { System.out.println("周杰伦"); System.out.println("蔡依林"); Thread.sleep(60); } } ca…