• 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

JspWriter question

 
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
How are the methods print(String) and write(String) are different on this class?
Thanks,
Aruna.
 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear aruna,
write(String) method is of java.io.Writer class which is extended by JspWriter class, who(JspWriter) is abstract in nature.
So the write(String) method comes through that channel, where as print(String) is a method of JspWriter class.
=> The Print(String) method in API has written following statements:

the string's characters are converted into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the Writer.write(int) method.


So, It is obvious that, Methods do not hv technical difference between them, but the important part plays by print(String) method is while converting to platform's default character encoding.
Hope i m clear enough,
Best regards, Dharmin
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic