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
What is fail first in java?
Why is static used?
Can we write multiple catch blocks under single try block?
What are the different types of sorting in java?
How can constructor chaining be done by using the super keyword?
When does an object becomes eligible for garbage collection in java?
What is a Transient Object?
What is the purpose of javac exe?
What are voids?
Explain when we should make an instance variable private.
What do you mean by jjs in java8?
Is java free for commercial?
What is ascii code?
How listener identify that the event came from a particular object?
How long will it take to learn java?