Home  >  Forum  >  Core Java
Post New Query

Java programming please help?



Asked on October 18, 2013
How do I change the code to make it 90% hobbits and 10% wizards? I am lost here.

Thank you for your help


final int numActors = 20;
Actor[] collectionActors = null; // This line and next line are NOT usually split.
collectionActors = new Actor[numActors]; // I split them to let me watch program execution under the debugger.

for (int i=0; i<numActors; ++i) {
// TODO create a mix of Hobbit (90%) and Wizard (10%) objects
collectionActors[i] = new Hobbit();


Replied on October 18, 2013
You need to do more explanation, what exactly you want to do. Is this the Hobbit and Wizard object count to be 90% and 10%?

Write Answer




©2019 concretepage.com | Privacy Policy | Contact Us