explain System.out.println
Answer Posted / kamineni
Here System is a class available in java default package
java.lang.. It contains fields and methods that support
standard input n output facilities.System class has Final
modifier so it cant be inherited..
out is a static field in System class of PrintStream
type(printstream is a built in class contains methods to
print different data tyes)
println is the method of the printstream class to print
different values..
Example:
class System
{
static PrintStream out;
'
'
'
'
}
class PrintStream
{
void println();
void print();
'
'
'
}
System.out.println() means
System is a class and out is a static field so we acces it
by using class name..
so System.out
and println is a method of PrintStream..so non static
methods should access using reference or object and out is
the reference(holds the adress of PrintStream object) of
PrintStream so we access it using out..
so System.out.println()..
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
How are this() and super() used with constructors in java programming?
What are the two main uses of volatile in Java?
What is the purpose of a transient variable?
What classes of exceptions may be thrown by a throw statement?
What is pass by value?
What is variable and example?
What is difference between printf and scanf?
Why Do I Get A "permission Denied" Error After Downloading The .jnlp Java Launcher For The Vkvm?
What do bitwise operators do?
What is use of map in java?
What is singleton class in ruby?
What are exceptions
What is assembly used for?
Why do we use variables?
What is the difference between quicksort & mergesort? When should they be used? What is their running time?