This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes inner class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "inner class" Watch "inner class" New topic
Author

inner class

kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1371
I have inner class. How can i add System.out.println()..within inner class...This inner class does not contain main()
Liam Tiarnach
Ranch Hand

Joined: Aug 06, 2004
Posts: 51
Originally posted by kri shan:
I have inner class. How can i add System.out.println()..within inner class...This inner class does not contain main()


Check this link out...
http://java.sun.com/docs/books/tutorial/index.html
It has the answer to this and many more questions that you may have...


- Liam...<br />- ' He who never sleeps... '
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
You can call System.out from anywhere. I wonder why some people seem to think you can do so only from a main method...

Of course you may not like the result, for example if your class is used inside an application server output to System.out may well be suppressed.


42
kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1371
Hi Jeroen Wenting
Of course you may not like the result, for example if your class is used inside an application server output to System.out may well be suppressed.

I am not getting the meaning of the above mentioned statement.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: inner class
 
Similar Threads
Doing some "cleanup" before closing a program, how?
confused question
static inner class instantiation
Inner Classes
extend inner class