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

Can you run java program without main method?

645


How do you end a program?

655


Can we have two main methods in a java class?

627


what is method reference in java 8?

649


What things should be kept in mind while creating your own exceptions in java?

733






What do you mean by byte code?

601


Explain the difference between jdk, jre, and jvm?

685


What is the purpose of assert keyword used in jdk1.4.x?

658


How can we make a class singleton?

686


What does singleton mean in java?

601


placement papaers of spring computing technology

1108


What is the point of polymorphism java?

627


How do you represent a space in regex java?

608


What is string and its types?

721


What is mean by exception?

642