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 / srinivas battula

Java is Pure OOPS... Try writing a java program without
Class. i.e. public class Test {}, In this way it satisfies
Oops Concept.
Abstraction: Take any thing like static, system,etc. we
don't know the internal functionalities, but by calling
them we are achieving the task. Here it is hiding the
complexities but representing essential features.
Encapsulation: By writing a program you are grouping all
the methods, variables,etc there by satisfying Encapsulation
Inheritence: When reusability occurs, you satisfy this
concept.
Polymorphism: We achieve it through Overloading and
Overriding in Java in most of the concepts.

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Differentiate between nested and inner class in java.

777


What are the legal operands of the instanceof operator?

787


What is a “stateless” protocol ?

755


Java Compiler is stored in JDK, JRE or JVM?

1246


Is array an object in java?

733


Is arraylist ordered in java?

774


What is array and arraylist in java?

779


What does localhost mean?

703


What is a classloader in java?

744


Why is java multithreaded?

740


Is integer a class?

792


What is split return?

689


Can a list be null in java?

768


Can we clone singleton object in java?

796


Can we change the value of static variable?

710