Hello,
I've looked around and cannot seem to find how to create and array of this structure. I can instantiate the class PCB just fine but I can't seem to figure out how to create an array of them. This is a small amount of my code. Can anyone help me?
Code:import java.io*; import java.lang.*; import java.util.*; public class ossim{ public static void main(String[] args) throws IOException{ PCB newProcess = new PCB(); /* how do i create an array of these? */ /* ie. "PCB newProcess[10] = new PCB(); */ } } class PCB{ int PID; /* process id number */ String name; /* name given from input */ int priority; /* priority of process */ String statusType; LinkedList statusList = new LinkedList(); int[] crTree = new int[10]; LinkedList otherResources = new LinkedList(); }


Reply With Quote


Bookmarks