Why cant we define System.out.println() inside a class
directly?
Answer Posted / venkatachalapathy
we Directly write this line i.e System.out.println()
directly inside a class because println method is static
method in output stream class which are sub classes of
system class.
so every time this method is overridden in our program....
so static methods doesnt require a creation of object.....
| Is This Answer Correct ? | 3 Yes | 3 No |
Post New Answer View All Answers
What is constructor chaining and how is it achieved in java?
Is java still relevant?
What means public static?
What is the primary benefit of encapsulation?
Explain the difference between abstraction and encapsulation.
Explain differences between collection api and stream api?
Which category the java thread do fall in?
what is thread? What are the high-level thread states? Or what are the states associated in the thread? : Java thread
Why does abstract class have constructor?
What is the difference between a vector & an array list?
Tell me about different OOPS concepts.
what is a thread pool in java and why is it used?
How is tree Mirroring implemented?
What are green threads in java?
What is Java Shutdown Hook?