Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

whats the logic in this statement PrintWriter out=response.getWriter();

 
Vishal Hegde
Ranch Hand
Posts: 1077
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is PrintWriter a class if yes how come its now declared as

PrintWriter out=new PrintWriter();
out=response.getWriter;


and as it is assigned in a method it cannot be initialised to a null value so what value is it assigned to??
 
Vijitha Kumara
Bartender
Posts: 3913
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vishal Hegde wrote:is PrintWriter a class if yes how come its now declared as
PrintWriter out=new PrintWriter();
out=response.getWriter;

I think you are talking within the context of JSP? Then "out" (which is of type JspWriter ), one of the implicit variables in JSPs are declared and initialized for you in the translation phase of the JSP.
 
Vishal Hegde
Ranch Hand
Posts: 1077
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am new to advanced java and its really confusing is there any ebook which is available free for me because to print a simple hello world i am finding it difficult to understand the basic of this stuff i even searched for advanced java for dummies but was of no use
 
Vijitha Kumara
Bartender
Posts: 3913
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vishal: Here are some free tutorials you can try to get started.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic