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


Please Help Members By Posting Answers For Below Questions

Is zero a positive integer?

537


I want my class to be developed in such a way that no other class (even derived class) can create its objects. How can I do so?

525


Can we serialize static variables in java?

657


What is extension method in java?

565


What is a Hash Table? What are the advantages of using a hash table?

610






What is string data type?

559


Why wait(),notify(),notifyAll() methods defined in Object class althought we are using in only threads.

2376


Difference between throw and throws?

624


What is the formula to calculate percentage?

540


What is the main purpose of serialization in java?

530


Is null an object java?

542


What is a variable simple definition?

581


Is hashset sorted in java?

670


What is a memory leak in java?

549


What is meant by object oriented programming – oop?

548