Win a copy of Getting started with Java on the Raspberry Pi this week in the Raspberry Pi forum!
  • 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Liutauras Vilda
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Piet Souris

Sybex Java OCP 8 Study Guide small typo Chapter 3 page 162 553

 
Ranch Hand
Posts: 215
11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sybex Java OCP 8 Study Guide small typo Chapter 3 page 162 , answer on 553
Review Question 3 answer

3:    List list = new ArrayList();
4:    list.add("one");
5:    list.add("two");
6:    list.add(7);
7:    for (String s: list)
8:    System.out.print(s);

Lines 3 through 7 create an ArrayList without generics.

It should be Lines 3 through 6 create an ArrayList without generics.
 
author & internet detective
Posts: 41763
885
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Confirmed and added the errata.

I also checked our Java 11 book. We changed that question significantly so the error doesn't apply there.
 
It is difficult to free fools from the chains they revere - Voltaire. tiny ad:
Low Tech Laboratory
https://www.kickstarter.com/projects/paulwheaton/low-tech-0
reply
    Bookmark Topic Watch Topic
  • New Topic