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

What is the collections api?

566


Is hashmap thread safe?

550


I want to control database connections in my program and want that only one thread should be able to make database connection at a time. How can I implement this logic?

632


How do you ensure that n threads can access n resources without deadlock?

802


Explain scope or life time of local variables in java?

553






What is java virtual machine and how it is considered in context of java’s platform independent feature?

643


What is hashing principle in java?

548


What is the synonym of string?

529


What do you mean by checked exceptions?

529


What is tostring () method?

534


Can we change the scope of the overridden method in the subclass?

838


What does n mean in java?

501


What is the mapping mechanism used by java to identify IDL language?

584


What is string value?

632


What is super constructor?

544