Your code is completely legal and what you say is totally true. I think You misunderstood; the corresponding figure in the book is mentionaning about the code snippet below.
Jeet Jain wrote:But thats exactly my problem. The format method() you specified (same as in API) above takes 3 parameters but my format() calls with 1 parameter.
NumberFormat doesn' t override format(Object), thus we must look at the parent class (Format) implementation. In that class, format(object) method calls an its abstract method (that must be implemented by subclass->NumberFormat ). The abstract method implementation of NumberFormat is at my previous post. ;)
Below code snippet is run; when nf.format(s) is called. As you can see, Long, Short, Integer, Byte, AtomicInteger and AtomicLong is expected by this method, thus you get an IllegalArgumnentException with specified message at runtime.
I' ve tried, it works with a file on remote machine at network. The exception is pointing your credentials on the remote machine. Do you have access to write on file?
A subclass implements abstract methods. In order to access non abstract methods in an abstract class, you have to intiate it with a subclass. Thats way there is no problem.