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 is indexof?
How many classes can any class inherit java?
Tell me how many ways are there to initialise an integer with a constant.
What is charat java?
Explain about public and private access specifiers?
What is the purpose of static methods and variables?
What is ctrl m character?
What is a local class in java?
What is the best definition for data?
What is javac_g?
Explain the differences between static and dynamic variables?
What is return keyword in java?
What loop means?
What is the difference between the reader/writer class hierarchy and the inputstream/outputstream class hierarchy in java programming?
Can java list contain duplicates?