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 loops in java? What are three types of loops?
How to access arraylist elements in java?
What is a function in programming?
How to overcome the exception object reference not set to an instance of object?
What is parameters example?
What is method with example?
What is unicode datatype?
Explain about complier design(phases)
How to declare an arraylist in java?
What is treeset and treemap in java?
How do you check whether the list is empty or not in java?
How do you check if a string contains only numeric digits?
How a string is stored in memory?
Difference between current previous versions of Java?
What is equlas() and hashcode() contract in java? Where does it used?