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
Explain public static void main(string args[]) in java.
Explain the difference between a Thread and a Process.
How to find the given number is a prime number or not by getting input from the user
What is a flag and how does it work?
what are different ways in which a thread can enter the waiting state? : Java thread
How will you print number in reverse (descending) order in BST.
What is substring in java?
Explain jvm, jre, and jdk?
what is the difference between future and callable interface in java?
What do you mean by data type?
Difference between notify() method and notifyall() method in java?
What is the list interface in java programming?
What is a method in programming?
What is a priority queue java?
What is the static method?