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
Explain the difference between hashmap and hashtable in java?
Explain the purpose of garbage collection in Java?
Can we use return in constructor?
How many types of memory areas are allocated by JVM in java?
Where is singleton pattern used?
what do you understand by the term string with respect to java?
What is type conversion in java?
What is the type of lambda expression?
what are the methods in object?
What are recursive functions? Give some examples?
Justify your answer that you can't define a method inside another method in java, if you can then how?
Is set ordered?
Can we nested try statements in java?
Explain throw keyword in java?
What are abstract methods in java?