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 / dhawal

1]here we use static main method means single copy of that
method is created in memory for that particular class means
we can not accept main method out side the class we can call
this method by using class name,ie javac a.java means this is
ENCAPSULATION
2]here println is a method, its defination writen in out
that is output straem means we obtain
INHERITANCE
3]polymorphisum means one name many form basically base
class pointer in our example when u pass String args[] to
main but can manipulate all type of data inside main this is
POLYMORPHISUM

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you convert string to int in java?

546


Will minecraft java be discontinued?

630


What is split return?

481


Is null a string in java?

544


What are the basic control structures?

486






Explain the difference between abstract classes and interfaces in java?

580


Is array primitive data type in java?

520


What is meant by oops concept in java?

492


What are the topics in advance java?

499


Can we override protected method in java?

562


What is the difference between access specifiers and access modifiers in java? 16

524


What is indexof?

527


Class c implements interface I containing method m1 and m2 declarations. Class c has provided implementation for method m2. Can I create an object of class c?

1004


How to obtain a performance profile of java program

524


How do you clear a list in java?

586