Home  >  Forum  >  Core Java
Post New Query

Java programming please help?

joined on
October 10,2013
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();
joined on
March 14,2013
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

Copyright ©2017 concretepage.com, all rights reserved |Privacy Policy | Contact Us