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 are the differences between heap and stack memory in java?
How to print nodes of a Binary tree?
What are the default and parameterized constructors?
What is an escape character in java?
What is operator overloading. Is it is supported in java?
How many techniques can be employed to create a string object?
What is the primitive type byte?
How does the garbage collector works in java?
When is update method called?
What is variable declaration and definition?
What is the difference between jfc & wfc?
What is the use of a conditional inclusion statement in Java ?
What is the synonym of procedure?
What is factor r?
Which class is used by server applications to obtain a port and listen for client requests?