• 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

Errata in OCA/OCP 7 Kathy Sierra Bert Bates

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Everyone

Though I did go thru the errata page (https://coderanch.com/t/641206/certification/Errata-OCA-OCP-Java-SE) for the OCA/OCP 7 study guide by Kathy Sierra but I did not find this in there.

I would like to check with everyone regarding 1 of the Self Test question in chapter 11, Generics and Collections.

This is question 1 of self test of chapter 11.
For me the correct answer is Option B. I validated the code as well by running with Option B in eclipse and it works without any compilation error, where as in the Self Test Answers Option A is marked as correct. For the Option B it says, because List is an interface, so you cant say new List(). The new List thing happens in Option A rather than Option B

Which statements could be inserted at // INSERT DECLARATION HERE to allow this code to compile and run?



  A.      List<List<Integer>> table = new List<List<Integer>>();
  B.      List<List<Integer>> table = new ArrayList<List<Integer>>();
  C.      List<List<Integer>> table = new ArrayList<ArrayList<Integer>>();
  D.      List<List, Integer> table = new List<List, Integer>();
  E.      List<List, Integer> table = new ArrayList<List, Integer>();
  F.      List<List, Integer> table = new ArrayList<ArrayList, Integer>();
  G.      None of the above

P.S : I have the Indian edition hardcopy book.

Many thanks
Sourabh
 
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you are correct, but maybe late to the party because the Java7 exams are now pretty old. I don't know whether they are still current.
 
Can you smell this for me? I think this tiny ad smells like blueberry pie!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic