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 is indexof?

747


How many classes can any class inherit java?

759


Tell me how many ways are there to initialise an integer with a constant.

898


What is charat java?

759


Explain about public and private access specifiers?

802


What is the purpose of static methods and variables?

790


What is ctrl m character?

767


What is a local class in java?

829


What is the best definition for data?

744


What is javac_g?

788


Explain the differences between static and dynamic variables?

890


What is return keyword in java?

837


What loop means?

763


What is the difference between the reader/writer class hierarchy and the inputstream/outputstream class hierarchy in java programming?

867


Can java list contain duplicates?

814