File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 1056

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: 3860

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: 1056

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: 3860

Vishal: Here are some free tutorials you can try to get started.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: whats the logic in this statement PrintWriter out=response.getWriter();