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

📄 main.java

📁 solution to the simulation of the vasculating buffer
💻 JAVA
字号:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package examen;import java.util.Random;/** * * @author ANGEL */public class Main {    /**     * @param args the command line arguments     */    public static void main(String[] args) {        // TODO code application logic here        buffer objbuffer;        Random r = new Random();        int valor,i;        System.out.println("Cuantos hilos");        int tam = Leer.datoInt();        hilo hilos[] = new hilo[tam];        objbuffer = new buffer(2);        valor = r.nextInt(500);        int j =0;        for(i =0;i<tam;i++){  /*          if(i<3){                hilos[i] = new hilo(objbuffer,i,true);            }else*/                hilos[i] = new hilo(objbuffer,i,r.nextBoolean());        }        for(i=0;i<tam;i++){            try{                hilos[i].t.join();            }catch(InterruptedException e){            }        }        objbuffer.recorrercolas();   }}

⌨️ 快捷键说明

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