main.java
来自「solution to the simulation of the vascul」· Java 代码 · 共 44 行
JAVA
44 行
/* * 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 + =
减小字号Ctrl + -
显示快捷键?