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

How does singleton class work?

513


Can we convert stringbuffer to string?

552


How do you escape sequences in java?

578


Highest level event class of the event-delegation model?

3486


Explain what pure virtual function is?

579






What is lossy conversion in java?

538


What are keywords give examples?

564


Can you explain the meaning of aggregation and composition

559


Explain the difference between extends thread vs implements runnable in java?

521


What is nullpointerexception in java?

513


Explain hashset and its features?

563


What is an abstract class and what is it’s purpose?

527


Give an example of use of pointers in java class.

554


What is the meaning of variable in research?

545


Why can't we make a class private in java?

526