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
hi am an engineering student and my next plan is for ms in either in us or australia i got my passport but i dont know anything bout visa can u give brief idea 1)How to get prepared for visa and 2)How to apply for top universities and 3)How to pay the fee and so on These all are basic questions plz give me a clear idea
What is the primitive type byte?
How strings are created in java?
What is one third plus one third as a fraction?
Explain about main thread in java?
What is object-oriented programming?
What are thread safe functions?
What are the advantages of inner classes?
What is meant by string is immutable?
In a program, initializing an array of 100 KB is throwing an out of memory exception while there is 100 MB of memory available. Why?
What is thread start?
What is indexof in java?
What is method reference?
What is gc()?
when to use ArrayList and when to use HashMap in webApplication.