Why cant we define System.out.println() inside a class
directly?
Answers were Sorted based on User's Feedback
Answer / madhu
We can't because The method signature matters when you are
declaring the method. we can't give a name with
System.out.println, but we can define println()
| Is This Answer Correct ? | 4 Yes | 3 No |
Answer / madhu
we can override only class methods and we can't override the
output Stream methods.
| Is This Answer Correct ? | 2 Yes | 2 No |
Answer / shahid
because println method is not abstract method it is method
of output stream class so we cant override.and it is just
overloded method.
| Is This Answer Correct ? | 3 Yes | 3 No |
Answer / 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 |
Answer / chandan
because a class is a logical structure and its definition is
group of entities but when we need some functionality we
need to define inside the function
| Is This Answer Correct ? | 1 Yes | 1 No |
Define an applet in java?
What are types of Java applications?
What is deadlock and how to avoid this?
Can we have more than one package statement in source file ?
What is a parent class in java?
Urgent requirement of JAVA/.NET/QA in a CMMI level3 MNC for Pune location.
What is the ResourceBundle?
2 Answers Elementus Technologies,
What are Encapsulation, Polymorphism and Inheritance?
What is the difference between the >> and >>> operators?
What is jit and its use?
Explain about static nested classes in java?
Why does the integer quotient -0/3 yield 0, but the double quotient -0.0/3.0 yields – 0.0?