Why cant we define System.out.println() inside a class
directly?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is module with example?

712


Is java a pure object oriented language?

754


What is the meaning of course?

870


What is the relationship between class and object?

803


Are static members inherited to sub classes?

916


What is the use of default method in interface in java?

794


How do you create immutable object in java?

820


When is the finally clause of a try-catch-finally statement executed?

752


What is difference between variable declaration and definition?

764


Can a serialized object be transferred via network?

724


What is a variable and constant?

792


Can we have multiple public classes in a java source file?

811


What are constants and how to create constants in java?

776


Distinguish between a predicate and a function?

802


Why do we use string?

800