explain oops concepts with examples?

Answer Posted / arun from india in madurai

OOP is Nothing but Object Oriented Programming.
In OOPs concept is implimented in our real life systems.
OOPs have following features
1. Object - Instance of class
2. Class - Blue print of Object
3. encapsulation - Protecting our data
4. polymorphism - Different behaviors at diff. instances
5. abstraction - Hidding our irrelavance data
6. inheritence - one property of object is aquring to
another property of object

Simple Ex.

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

Simple,
car is a object b'coz it having more functions.
car is a class b'coz it contain more parts and features
inside.
car is a Encapsulation B'coz it protected some unwanted
parts or functions to user
car is a Polymorphism b'coz it have different speed as
display in same speedometer
car is a Abstraction b'coz it hidding more parts by coverig
such as engine,disel tank
car 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 ?    438 Yes 63 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many java versions are there?

651


What does || || mean in math?

597


What is the vector class in java programming?

653


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

674


how many types of Inheritance?

776






What are adapter classes?

683


Can a class extend more than one class?

720


What is local class in java?

634


What is java util hashmap?

611


What is a static class in java?

632


What are inner classes or non static nested classes in java?

805


Can we override constructors in java?

757


Can I declare class as static or private?

633


How many bits is a word?

663


Can we increase size of array?

669