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


Please Help Members By Posting Answers For Below Questions

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

1455


What is the primitive type byte?

565


How strings are created in java?

549


What is one third plus one third as a fraction?

475


Explain about main thread in java?

600






What is object-oriented programming?

563


What are thread safe functions?

499


What are the advantages of inner classes?

494


What is meant by string is immutable?

505


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?

563


What is thread start?

510


What is indexof in java?

503


What is method reference?

506


What is gc()?

567


when to use ArrayList and when to use HashMap in webApplication.

3872