Just asking if I have the right understanding
System.out.println();
System is the package out is the class println() is the method
If this is wrong, then please tell me what the correct answer is.
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 the class, out
is a static instance of a PrintWriter
class. This instance is contained in System
but since it's static it belongs to the System
namespace itself and not to any instance of System
- Jack 2012-04-04 04:31
java.lang.Math
, Math
is a class - Louis Wasserman 2012-04-04 05:01
out is a static object of printstream class
System -class,
PrintStream -class
,
out - static object of PrintStream class
,
println - public method in PrintStream Class
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
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 NOT an object. It is a class that is designed to never be instantiated - Stephen C 2012-04-04 06:09
System
is a class from package java.lang.
out
is a public, static member of System
class, and println
is a method, yes.
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