aspose file tools
The moose likes Mock Exam Errata and the fly likes Few Questions from John Hunt's Mock Exam. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Mock Exam Errata
Reply Bookmark "Few Questions from John Hunt Watch "Few Questions from John Hunt New topic
Author

Few Questions from John Hunt's Mock Exam.

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
What is the name of the method used to schedule a thread for execution?
init();
start();
run();
resume();
sleep();
What should be the answer...start() or run() ???
What is the effect of adding the sixth element to a vector created in the following manner:

new Vector(5, 10);
A.An IndexOutOfBounds exception is raised.
B.The vector grows in size to a capacity of 10 elements
C.The vector grows in size to a capacity of 15 elements
D.Nothing, the vector will have grown when the fifth element was added
The answer given is C......But I feel it should be B.
Thanks & Regards.
sonkalp@yahoo.com
Gene Ehli
Greenhorn

Joined: Aug 11, 2000
Posts: 1
The constructor used to create the vector is:
public Vector(int initialCapacity, int capacityIncrement)
So the vectors new size would be the initialCapacity + capacityIncrement. In this problem it was constructed with Vector(5, 10), 5 + 10 = 15, so C is the correct answer.

 
 
subject: Few Questions from John Hunt's Mock Exam.
 
Threads others viewed
HELP ME
Vectors
vector
Adding an element in a Vector... ???
Hunt # 49
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture