• 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

Doubt about writer object

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can somebody please tell me whether writer is a class or an object... in K&B pg 436, the tables says the some i/o classes extend from writer.. which means writer is a class.... but on pg 437... the 2nd para says that writer is an object and not a class.. so why is it an object and not a class...

thanks...
 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unfortunately I don't have the K&B book with in front of me at the moment so I'm unable to refer to the section you noted.

java.io.Writer is an abstract class that provides basic methods for writing characters to a stream. Classes like FileWriter, BufferedWriter and PrintWriter extend from Writer and override or add additional functionality.

Because Writer is an abstract class you can't instantiate any objects. The section you're referring to may be referring to Writer objects generally meaning any class that extends Writer IS-A Writer.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic