Is it Abstarction not comes under Opps concept ?

Discussion in 'Object Oriented Concepts' started by punna, Jul 5, 2009.

  1. punna

    punna New Member

    I am somewhere read Abstraction is not a oop's concept it is real?if yes give Explanation or No give Explanation?
  2. vbraojava

    vbraojava New Member

    Hi Punna,

    Where you saw like that ?

    Abstraction is also comes under Oops concept. Don't be confuse....

    Abstraction, Inheritance and Polymorphism are the main Oops concepts.
  3. m_k_sudhir

    m_k_sudhir New Member

    Actually, data abstraction and encapsulation are considered as a single unit. Data abstraction means making some data visible to the user and hiding others which are not relavant or secret.

    On the other hand, encapsulation means gathering all the abstracted data, their related methods(functionalities) and packing them as a single unit called a class.

    So both abstraction and encapsulation go hand in hand
  4. anitha.mca

    anitha.mca New Member

    Hi Punna,

    Abstraction z part of OOP concept

    OOPS Concept in detail...

    OOP stands for Object Oriented Programming. It’s all about classes and objects; a class is collection of member functions and variables with different scope of use and accessibility. An object can be a referred as an entity which gets properties and attributes from the class for which it has been created. It will be easy to explain classes and objects using real life example as below: -

    Let’s say we call Car a class, every car has some properties and features. The properties includes speed, number of gears it has, its mileage, suspension etc, whereas the features includes power windows, staring, breaks etc. Now Honda Civic will be called an object of the class car, and this object inherits all the features & properties of the class car and which can have values respective to the object.

    Inheritance – This is the first feature of an object oriented programming language, it means as soon as an object it created for a class its properties are automatically given to the object. Now depending upon the type of property the object can have value respective to it and there could be a property which will stay fixed.

    This is known as scope of the member variables & functions defined in the class. For example the class car has a property that it will have 4 wheels, which will remain same for almost every object that will be created from this class.

    So we can say that the scope of this property is private and can not be changed at objects level, whereas as a property maximum speed will have a scope public i.e. for every object that will be created this property can be different for every object.

    Polymorphism – This is the second feature of an object oriented programming language, and it means a function defined performing different functions as the variables passed to it changes.

    For example we define a function called ‘concat’ which can take two parameters. Now if the parameters passed are of the type integer the function will return sum of two numbers whereas if the parameters passed are characters then the function will return two charters concatenated.

    Encapsulation – Third and most important feature of any object oriented programming language. This is associated with data hiding, which means the value of a variable is accessible to the objects of class but they can not change the value assigned to the variable. If scope of a variable is defined as private then the same will also not be accessible to all objects of a class.

    Abstraction – Last but not the least this feature of any OO programming, this feature gives the option to represent the needed information in program without disclosing all details. Also this feature gives the possibility of creating user defined data types increases the power of programming language.

    Hope this helps you to clearly understand OOPS concepts...
  5. vbraojava

    vbraojava New Member

    Hi Anitha,

    Good reply with good explanation....
  6. anitha.mca

    anitha.mca New Member

    Thanks Rao...
  7. mgr_mekala

    mgr_mekala New Member

    cann u pls list out the scenario where encapsulation is used in a simple javaprogramm
  8. anitha.mca

    anitha.mca New Member

    In simple terms, we can say 'Encapsulation -Data Hiding -binding data and code together and hide it from external users from misuse of data' ,this is implemented n java programs using access specifiers/keywords like private,public,protected..

    Hpe this helps..
  9. kapilkumarshukla

    kapilkumarshukla New Member

    Can u plz show the difference b/w Encapsulatioin and Abstraction through a program using Java code
  10. anup.lath

    anup.lath New Member

    Encapsulation and abstraction

    Making the instance variables private and defining public setter and getter methods to access them is Encapsulation.

    By Abstraction we force the first concrete subclass to implement all abstract methods of abstract class to implement, because abstract methods dont have any method body.
    Last edited: Aug 5, 2009
  11. anneroberts

    anneroberts Member

    Abstraction also comes under OOPS Concept. Abstraction (from the Latin abs, acceptation abroad from and trahere, acceptation to draw) is the action of demography abroad or removing characteristics from article in adjustment to abate it to a set of capital characteristics.

Share This Page