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
How are observer and observable used in java programming?
What are different types of classloaders?
Is java 1.7 the same as java 7?
Under what conditions is an object’s finalize() method invoked by the garbage collector?
What happens if we don’t override run method ?
Can You Have Virtual Functions In Java?
What is the access scope of protected access specifier?
What will happen when using pass by reference in java?
what are the high-level thread states? : Java thread
What is initial size of arraylist in java?
What are conditionals and its types?
Justify your answer that you can't define a method inside another method in java, if you can then how?
What is the purpose of the main method?
What is the purpose of lambda expressions?
What is array in java?