we know that every java prog must follows OOPS Principles.
Anybody can answer, HOW THE FOLLOWING PROGRAM FOLLOWS OOPS
CONCEPTS i.e, Inheritance,Polymarphism,Encapsulation?
class a{
public static void main(String args[]){
System.out.println("Hello World");
}
}

Answer Posted / sree

Inheritance: Every class is extended of Object class, so in
here a extends Object. this is Inheritance.

Polymorphism: means single entity multiple views.
here only one method is there. if here multiple views, then
only it would become like Polymorphism concept.

Encapsulation: Wrapping up of data and code means methods,
variables, code, and all. every java program is based on
Encapsulation concept.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the differences between heap and stack memory in java?

640


How to print nodes of a Binary tree?

1857


What are the default and parameterized constructors?

644


What is an escape character in java?

636


What is operator overloading. Is it is supported in java?

602






How many techniques can be employed to create a string object?

638


What is the primitive type byte?

670


How does the garbage collector works in java?

657


When is update method called?

765


What is variable declaration and definition?

637


What is the difference between jfc & wfc?

692


What is the use of a conditional inclusion statement in Java ?

681


What is the synonym of procedure?

634


What is factor r?

628


Which class is used by server applications to obtain a port and listen for client requests?

590