This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes JSP and the fly likes  whats the logic in this statement PrintWriter out=response.getWriter(); Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » JSP
Bookmark " whats the logic in this statement PrintWriter out=response.getWriter();" Watch " whats the logic in this statement PrintWriter out=response.getWriter();" New topic
Author

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

Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1055

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??


http://www.lifesbizzare.blogspot.com || OCJP:81%
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3827

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.


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1055

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

Joined: Mar 24, 2008
Posts: 3827

Vishal: Here are some free tutorials you can try to get started.
 
wood burning stoves
 
subject: whats the logic in this statement PrintWriter out=response.getWriter();