摘要: 定义一个dog类 public class Dog { private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } } 定义一 阅读全文
posted @ 2022-07-05 18:43 前端导师歌谣 阅读(27) 评论(0) 推荐(0)
摘要: public class SynCode implements Runnable{ public void run(){ synchronized (this){ Thread current=Thread.currentThread();//获取当前线程 for(int i=1;i<10;i++) 阅读全文
posted @ 2022-07-05 18:43 前端导师歌谣 阅读(57) 评论(0) 推荐(0)
摘要: import java.util.PrimitiveIterator; public class Classroon implements Runnable { private Thread student;//学生线程 private Thread teacher;//老师线程 public Cl 阅读全文
posted @ 2022-07-05 18:43 前端导师歌谣 阅读(22) 评论(0) 推荐(0)
摘要: //利用两个线程实现1到100的计算 public class MyRannable implements java.lang.Runnable{ private Thread th_0; private Thread th_2; int sum=0;//存储累加和的结果 int i=1; publ 阅读全文
posted @ 2022-07-05 18:43 前端导师歌谣 阅读(224) 评论(0) 推荐(0)
摘要: //线程 public class test102 extends Thread{ public void run(){ while (true){ System.out.println("我是线程1"+this.getName()); try { Thread.sleep( 1000 ); }ca 阅读全文
posted @ 2022-07-05 18:43 前端导师歌谣 阅读(45) 评论(0) 推荐(0)
摘要: //线程 public class test102 extends Thread{ public void run(){ while (true){ System.out.println("我是线程1"+this.getName()); try { Thread.sleep( 1000 ); }ca 阅读全文
posted @ 2022-07-05 18:43 前端导师歌谣 阅读(26) 评论(0) 推荐(0)
摘要: import javax.imageio.IIOException; import java.io.*; import java.util.Date; //字符输入流 public class FileManagerChar { public static void readCharFile(Fil 阅读全文
posted @ 2022-07-05 18:43 前端导师歌谣 阅读(26) 评论(0) 推荐(0)
摘要: import javax.imageio.IIOException; import java.io.*; import java.util.Date; //字符输入流 public class FileManagerChar { public static void readCharFile(Fil 阅读全文
posted @ 2022-07-05 18:43 前端导师歌谣 阅读(26) 评论(0) 推荐(0)
摘要: import javax.imageio.IIOException; import java.io.*; import java.util.Date; //字符输入流 public class FileManagerChar { public static void readCharFile(Fil 阅读全文
posted @ 2022-07-05 18:43 前端导师歌谣 阅读(34) 评论(0) 推荐(0)
摘要: import javax.imageio.IIOException; import java.io.*; import java.util.Date; //字符输入流 public class FileManagerChar { public static void readCharFile(Fil 阅读全文
posted @ 2022-07-05 18:43 前端导师歌谣 阅读(43) 评论(0) 推荐(0)