• 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

K&B page 568 minor bugs

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the table 7-4 there are listed some methods from java.util.Arrays and java.util.Collections, and some of them have the access modifier and some of them not. All the methods should be marked as public.
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might want to check the errata. I am not sure if this is listed there but it would sure be of help to you.

I cant remember the link though Search this forum and you will find people who have provided the errata link
 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I went through the javadoc 6.
All the methods including those which are not declared as public are actually, public!
The asList, binarySearch or equals in Arrays are all public.
Similar is the case with methods of Collections class.
 
Marius Paraschiv
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@John Meyers

Before I have posted this, I have looked at this errata and this is not on the list. Is there any new errata list ?

@Bhushan Chhajed

Arrays and Collections are utility classes and they must mark their api methods as public to be accessible by any class. Don't mistake utility classes with interfaces, where you don't have to type public abstract in front of the methods. I have looked even in the source code of the JDK(I'm using 1.5.0_15) and of course the methods are marked public.


Another little typo is on the page 610:

The generics type identifier can be used in class, method, and variable declarations:
class Foo<t> { } // a class
T anInstance; // an instance variable
Foo(T aRef) {} // a constructor argument
void bar(T aRef) {} // a method argument
T baz() {} // a return type
The compiler will substitute the actual type.

"t" must be "T"

[ July 06, 2008: Message edited by: Marte Marte ]

[ July 06, 2008: Message edited by: Marte Marte ]
[ July 06, 2008: Message edited by: Marte Marte ]
 
Bhushan Chhajed
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Marte Marte:
[QB@Bhushan Chhajed

Arrays and Collections are utility classes and they must mark their api methods as public to be accessible by any class. [/QB]


Have I said something else?
 
Marius Paraschiv
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, I have misunderstood your first response, my fault.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic