Results 1 to 4 of 4
Thread: Java basic question
- 04-17-2009, 01:54 PM #1
Member
- Join Date
- Apr 2009
- Posts
- 12
- Rep Power
- 0
Java basic question
Hi,
I really don't understand, why the statement System.out.println() is correct. First, the out variable returns PrintStream object, which has println method, and this is in java.io package. So, how complier finds it? This is making me bemuse .
Thanks in advance for any valuable suggestion.
JJ
- 04-17-2009, 02:38 PM #2
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 8
out doesn't "return" a PrintStream object, it is a PrintStream object.
- 04-17-2009, 08:02 PM #3
java.io.PrintStream is used only in the class java.lang.System, which has already been complied. You only need imports when you explicitly use a class name.
Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
How To Ask Questions The Smart Way
- 04-17-2009, 08:09 PM #4
You can actually import java.lang.System.*; and then just type out.println()
(pointless fact but a little neat I guess)Liberty has never come from the government.
Liberty has always come from the subjects of government.
The history of liberty is the history of resistance.
The history of liberty is a history of the limitation of governmental power, not the increase of it.
Similar Threads
-
Basic question on OOP.
By madthinker in forum New To JavaReplies: 7Last Post: 01-26-2009, 07:09 PM -
Basic MouseListener Question
By jshailes in forum AWT / SwingReplies: 9Last Post: 01-15-2009, 08:58 AM -
Basic array question
By jigglywiggly in forum New To JavaReplies: 12Last Post: 01-09-2009, 04:44 PM -
Basic question about EJB
By javaplus in forum Enterprise JavaBeans (EJB)Replies: 2Last Post: 07-15-2008, 05:44 PM -
Very basic question
By gvi in forum New To JavaReplies: 2Last Post: 10-30-2007, 06:30 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks