• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content




This slideshow is the basics of Object Oriented Programming Concepts made for freshers.

This slideshow is the basics of Object Oriented Programming Concepts made for freshers.



Total Views
Views on SlideShare
Embed Views



1 Embed 2

http://www.slideshare.net 2



Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

    OOP OOP Presentation Transcript

    • OOP Concepts Created by - Om Vikram Thapa
    • OOP vs. POP
        • Emphasis is on data.
        • Divides code into logical chunks individuals of a team can be experts in, and outsiders can understand via interfaces
        • Supports code evolution: internals can always be re-written as long as interface stays the same.
        • Data security.
      • Emphasis is on procedures.
      • This programming technique can only be used in a very small program.
      • if the same statement sequence is needed at different locations, the sequence must be copied. If an error needed to be modified, every copy needs to be modified.
    • Procedure Program view Main Program Data Procedure 1 Procedure 2 Procedure 3
    • OOP Program view Data Object 3 Data 3 + Procedures 3 Object 2 Data 2 + Procedures 2 Object 4 Data 4 + Procedures 4 Object 1 Data 1 +Procedures 1
    • Main OOP Concepts:
      • Object
      • Class
      • Abstraction
      • Encapsulation
      • Inheritance
      • Polymorphism
    • Objects and Class
      • An object represents something with which we can interact in a program
      • A class represents a concept, and an object represents the embodiment of a class
        • A class is a blueprint for an object.
      • A class can be used to create multiple objects
      • A program models a world of interacting objects.
      • Objects create other objects and “send messages” to each other.
      • Each object belongs to a class; a class defines properties of its objects. The data type of an object is its class.
    • Abstraction
      • One of the chief advantages of object-oriented programming is the idea that programmers can essentially focus on the “big picture” and ignore specific details regarding the inner-workings of an object. This concept is called abstraction .
    • Encapsulation
      • Abstraction in OOP is closely related to a concept called encapsulation .
      • Data and the ways to get at that data are wrapped in a single package, a class. The only way to access such data is through that package. This idea translates to information hiding.
    • Inheritance
      • Another of the main tenets of OOP is inheritance . Inheritance allows programmers to create new classes from existing ones.
      • A child class inherits its properties and attributes from its parents, which programmers can change.
    • Polymorphism
      • Polymorphism describes how programmers write methods to do some general purpose function.
      • Different objects might perform polymorphic methods differently.
      • The ability of objects to respond differently to the same message or function call.
    • Examples
      • Object legislates how its data may be accessed ( encapsulation )
        • Once you have created an ADT for complex numbers, say Complex, you can use it in the same way like well-known data types such as integers.
        • Encapsulation provides a way to protect data from accidental corruption.
      • One class may be a special case of another ( inheritance )
        • Rectangle is like a square, plus a second (possibly) distinct value
        • Colored-Rectangle is like a rectangle, plus the concept of color
      • Different classes in a hierarchy behave correctly( polymorphism )
        • shape.getArea(a,b) = len*wid, if shape is a rectangle
        • shape.getArea(a) = PI*r2, if shape is a circle