Just asking if I have the right understanding
System.out.println();
System is the package out is the class println() is the method
If t
No,
System
is the class, which resides in java.lang
package (that's why you don't need to import it).out
is a static variable of System
class. It is public, so that you can access it from outside and it is static so that you it's associated to the class declaration and not to any instance of it.println()
is a method, indeed. And it is a method of out
variable, which is a PrintStream
instance.System
is not a package. It is a class
which is contained inside java.lang
package
Take a look here http://docs.oracle.com/javase/7/docs/api/java/lang/System.html
out
is a PrintStream
object (static
in case of System
class) in which println()
is one of the methods
System
is a class from package java.lang.
out
is a public, static member of System
class, and println
is a method, yes.
out is a static object of printstream class
System -class,
PrintStream -class
,
out - static object of PrintStream class
,
println - public method in PrintStream Class
No, your understanding is wrong.
"Then What is right" -
System
- a class,
out
- a static public member of type PrintStream
,
and oh yes println()
is a method.
You were 33% right ;) read java documentation for this here
System = class
out = static object of the PrintStream class
println() = method
read this http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/System.html