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 does the three dot emoji mean?
What is meant by polymorphism?
What are the new features in java 8? Explain
Is static a singleton?
What are the three types of design patterns?
What is the epoch date?
How big is a gigabyte?
List some important characteristics on jre
Given a singly linked list, how will you print out its contents in the reverse order? Can you do it with consuming any extra space?
What is the difference between static binding and dynamic binding?
Can we access the non-final local variable, inside the local inner class?
What is difference between hashset and hashmap in java?
What is arrays fill in java?
Do extraneous variables affect validity?
Can we override the private methods?