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 fail first in java?

823


Why is static used?

775


Can we write multiple catch blocks under single try block?

834


What are the different types of sorting in java?

743


How can constructor chaining be done by using the super keyword?

863


When does an object becomes eligible for garbage collection in java?

820


What is a Transient Object?

830


What is the purpose of javac exe?

787


What are voids?

743


Explain when we should make an instance variable private.

820


What do you mean by jjs in java8?

773


Is java free for commercial?

671


What is ascii code?

843


How listener identify that the event came from a particular object?

1724


How long will it take to learn java?

740