This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft 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 Java 8 in Action this week in the Java 8 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: 1368
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: 1368
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: inner class
 
Similar Threads
static inner class instantiation
confused question
Inner Classes
Doing some "cleanup" before closing a program, how?
extend inner class