explain System.out.println
Answer Posted / vishal
System :
Its a built-in class present in java.lang package.
This class has a final modifier, which means that, it cannot
be inherited by other classes.
It contains pre-defined methods and fields, which provides
facilities like standard input, output, etc.
out :
Its a static final field (ie, variable)in System class
which is of the type PrintStream (a built-in class, contains
methods to print the different data values).
static fields and methods must be accessed by using the
class name, so ( System.out ).
out here denotes the reference variable of the type
PrintStream class.
println() is a public method in PrintStream class to print
the data values.
Hence to access a method in PrintStream class, we use
out.println() (as non static methods and fields can only be
accessed by using the refrence varialble)
System.out.println();
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is a char in java?
What is diamond operator in java?
Why is boolean important?
how to convert Java project into Maven ?
What is the final method?
What are the differences between graph and tree?
Give reasons supporting that string is immutable.
Does java support multiple inheritances?
Why does java does not support multiple inheritance? Explain
How we can generate random numbers in java?
What is the default size of arraylist in java?
What is double checked locking in singleton?
What does the string method compareto () do?
When is the finally clause of a try-catch-finally statement executed?
What is the purpose of java?