explain oops concepts with examples?

Answer Posted / vaibhav pathak

OOP is Object Oriented Programming.
In OOPs concept is implimented in our real life systems.
OOPs have following features
1. Object - Instance of class
2. Class - Collection of Object(Methods and
variable)
3. encapsulation - Protecting our data by data hiding
encapsulation=abstraction+data hiding.
4. polymorphism - Different behaviors at diff. instances
5. abstraction - Hidding our irrelavance data and
showing necessary data to the user.
6. inheritence - one property of one object is aquring
by the another object.

Simple Ex.

Please assume u standing near a car. How to impliments our
OOPs concept for this scenario ?

Simple,
A motor bike is a object b'coz it having more functions.
motor bike is a class b'coz it contain more parts and
features
inside.
motor bike is a Encapsulation B'coz it protected some
unwanted
parts or functions to user
motor bike is a Polymorphism b'coz it have different speed
as
display in same speedometer
motor bike is a Abstraction b'coz it hidding more parts by
coverig
such as engine,disel tank
motor bike is a Inheritance b'coz one car is a property of
more
people. i mean your car is driving bu you, your friend and
your relatives.

Is This Answer Correct ?    25 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is defined as false sharing in the context of multithreading?

507


What is use of set in java?

495


Can a main method be overloaded?

573


What is a protected class in java?

538


What are the advantages of unicode?

545






Explain why wait(), notify() and notifyall() methods are in object class rather than in thread class?

554


How is abstraction implemented in java ?

544


How do you override a variable in java?

531


Describe different states of a thread.

577


What is a bubble sort in java?

545


What is singleton class in java and how can we make a class singleton?

572


What do you mean by compiler?

582


What are the types of web technologies?

526


What is functional interface in java example?

537


What are the steps involved to create a bean?

682