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
What is a java applet? What is an interface?
Is array size fixed in java?
If you do not want your class to be inherited by any other class. What would you do?
What is the difference between Java1.4 and Java1.5
Can a class be defined inside an interface?
How do you remove spaces in java?
does java support pointers?
What is the difference between call by reference and call by pointer?
What is purpose of find feature?
What is a consumer in java?
What an i/o filter?
What is the definition of tree ?
What do you mean by synchronized non access modifier?
What is an example of character?
What is the core java?