• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Mock Ques - John Hunt

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question no. 49. -- John Hunt Mock Exam
What is the effect of adding the sixth element to a vector created in the following manner?
new Vector (5, 10);
If anyone can clarify this. Thanks for your attention.
regards,
mondal
 
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Please see this thread.
http://www.javaranch.com/ubb/Forum24/HTML/006619.html

Cheers
Sahir
sahirshah@emirates.com http://www.geocities.com/sahirshah/
 
sabyasachi mondal
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by sabyasachi mondal:
Question no. 49. -- John Hunt Mock Exam
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
If anyone can clarify this. Thanks for your attention.
regards,
mondal


Thanks to Shair, Bill and Anil. Your previous explanations make it well clear. Still I would like to go with it with the following question (i am not sure whether it make sense!!)
What is the effect of adding the 3rd element to a vector created in the following manner?
Thanks for your attention again.
mondal


 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Excuse me for interruption, Can anyone give the link to John Hunt's Mock exam?
Wahid
 
Ranch Hand
Posts: 3141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Wahid,
You'll find links to nearly all the mock exams on Maha's Site.
Hope that helps.
Jane
 
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi sabyasachi,
adding 3rd element won't affect the vector size but adding 6th element will make the vector to grow to the capacity of 15 elements.
regards
deekasha
 
sabyasachi mondal
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by deekasha gunwant:
hi sabyasachi,
adding 3rd element won't affect the vector size but adding 6th element will make the vector to grow to the capacity of 15 elements.
regards
deekasha


Thank you Deekasha. I think I have full control over ti now.
regds,
Sabyasachi
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic