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

Explain thread life cycle in java?

799


What is serialversionuid?

791


Can we create a class inside a class in java?

760


Explain the inheritance?

782


What do you understand by looping in java? Explain the different types of loops.

810


How do you calculate square roots?

880


Why destructor is not used in java?

757


Can we sort arraylist in java?

797


What is the primary benefit of encapsulation?

792


How to check if a list is sorted in java?

810


Describe what a thread-local variable is in java?

796


How do you generate random numbers in java?

773


What are the types of strings?

800


What is an accessor?

1353


What is use of arraylist in java?

852