就像我的问题是,为什么它甚至不能打印里面的hi-print语句?
public class Processor {
Random random = new Random();
class Process {
int proId, prior, BurstLength;
}
ArrayList<Process> processList;
public static void main(String arg[]) {
}
public Processor() {
System.out.println("hi");
processList = new ArrayList<>();
for (int i = 0; i< 5 ; i++){
Process newProcess = new Process();
int temp;
l1:while(true){
int rand = 10 - 0;
temp = random.nextInt(rand)+0;
System.out.println(temp);
for (Process p:processList)
if (p.proId == temp)
continue l1;
break;
}
newProcess.proId = temp;
newProcess.prior = (int)Math.round(Math.random()*9)+1;
int range = 100 - 20 + 1;
newProcess.BurstLength = random.nextInt(range) + 20;
System.out.println("Process id\tPriority\tburst length");
System.out.println(newProcess.proId+"\t"+newProcess.prior+"\t"+newProcess.BurstLength);
}
}
}
慕姐4208626
相关分类