A Vector is declared as follows. What happens if the code tried to add 6 th element to this Vector new vector(5,10) (a) The element will be successfully added (b) ArrayIndexOutOfBounds Exception (c) The Vector allocates space to accommodate up to 15 elements

(a) and (c)
EXPLANATION: The 1 st argument in the constructor is the initial size of Vector and the 2 nd argument in the constructor is the growth in size (for each allocation)
This Vector is created with 5 elements and when an extra element (6 th one) is tried to be added, the vector grows in size by 10.

Showing Answers 1 - 1 of 1 Answers

Anita

  • Jul 28th, 2006
 

Answer:   A,C

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions