• 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

Exam Qs- collection- help!

 
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks!
1.Given that file is a reference to a File object that represents a directory, which code fragments will succeed in obtaining a list of the entries in the directory?
A]Vector filelist = ((Directory)file).getList();
B]String [] filelist = file.directory();
C]Enumeration filelist = file.contents();
D]String[] filelist = file.list();
E]Vecor filelist= (new Directory(file)).files();
2.Which of these statements concerning the collection interfaces are true?
A]Set extends collection
B]All methods defined in set are also defined in collection
C]List extends collection
D]All methods defined in list are also defined in collection
E]Map extends collection

3.Given two collection objects referenced by col1 and col2, which of these statements are true?
A]The operation col1.retainAll(col2) will not modify col1 object
B]Col1.removeAll(col2) will not modify col2
C]Col1.addAll(col2) will return a new collection object, containing elements from both Col1 and col2
D]Col1.containsAll(col2) will not modify the col1 object
 
Looky! I'm being abducted by space aliens! Me and this tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic