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. firstname.lastname@example.org
posted 16 years ago
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.