• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Questions on java.util package

 
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Q1)When you want to associate keys with values and you are using JDK1.2, which of the following classes are preferred?
a] Dictionary
b] HashTable
c] Properties
d] HashMap
e] TreeMap
answer given : d,e.
Q2)Which of the following are true about the following Vector
Vector v=new Vector (5,10)
a] Incorrect declaration
b] Initial capacity is 10 and capacity increment is 10
c] Initial capacity is 5 and capacity increment is 10
d] Initial capacity is 5 and capacity increment is 0
e] The default capacity increment of Vector is 10
Answer given : c,e.
Q3)If you want to read and evaluate expressions which of the following would you prefer?
a] Array
b] List
c] Vector
d] Stack
e] Map
Answer given : d.
Q4)Which of the following allows you to use null values?
a] HashSet
b] HashMap
c] HashTable
d] AbstractList
Answer given : a,b,d.
Q5)True or false?
a] Vector maintains their elements in insertion order
b] A Vector cannot expand more than its capacity
c] Vector provides only synchronized addition methods
d] Vectors holds only objects not primitives
Answer given : d.
Q6)Which of the following supports insertion, deletion and store growth very easier?
a] Array storage
b] Tree
c] Hashing
d] Linked List
Answer given : b,c,d.
Q7)Which of the following are true about BitSet
a] Individual bits cannot be examined, set or cleared.
b] The bit set will increase dynamically as needed to accommodate extra bits you add it.
Answer given : false, true.
Q8)Which of the following classes that are thread-safe?
a] HashMap and HashSet
b] Vector and HashSet
c] HashTable and Dictionary
d] Vector and HashTable
Answer given : d.
 
Ranch Hand
Posts: 1070
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
amit, try to keep your posts to one question. This makes it easier to search and easier for everyone to respond to.
Bill
 
Get off me! Here, read this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic