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 string subsequence method?
Can a class have 2 constructors?
can rmi and corba based applications interact ?
Is array synchronized in java?
Can we have multiple classes in single file ?
How do you empty a list in java?
What do you mean by an interface in java?
What does i ++ mean in Java?
Is java a utf 8 string?
If we allocate the memory using 'new' & de-allocated using 'free' then what will happen?
Are there structures in java?
Explain the difference between hashmap and hashtable in java?
What is a lambda expression ? What's its use ?
What is the range of a character variable?
What is variable explain with example?