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

Can a class be a super class and a sub-class at the same time? Give example.

795


What does math floor () do?

547


Can we override tostring method in java?

526


Explain the difference between serializable and externalizable in java?

535


Why do we need singleton class?

547






What is method in research paper?

570


What is the difference between numeric and integer?

509


What is a boolean expression in java?

529


Does google use java?

530


What are the six ways to use this keyword?

604


How hashmap increases its size in java?

485


What is the importance of hashcode() and equals() methods?

576


What is the purpose of garbage collection in java? When is it used?

536


What is the importance of static variable?

586


Why hashcode is used in java?

497