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

What is a java applet? What is an interface?

627


Is array size fixed in java?

534


If you do not want your class to be inherited by any other class. What would you do?

559


What is the difference between Java1.4 and Java1.5

1825


Can a class be defined inside an interface?

558






How do you remove spaces in java?

532


does java support pointers?

558


What is the difference between call by reference and call by pointer?

497


What is purpose of find feature?

609


What is a consumer in java?

564


What an i/o filter?

560


What is the definition of tree ?

585


What do you mean by synchronized non access modifier?

560


What is an example of character?

552


What is the core java?

539