|  Home   |  Contact Us   |  Online Exam   |  Tech World   |  Jobs    |  Member Login
        Object          

Object is nothing but combination together "State and Behavior".
          State -> Variable,
          Behavior -> Functions or Methods.

Real-World Objects Example: your Dog.

          State        (Name, Color, Breed, Hungry).
          Behavior   (Barking, Fetching, Wagging tail).

Make sure to write down your observations. As you do, you'll notice that real-world objects vary in complexity; your desktop lamp may have only two possible states (on and off) and two possible behaviors (turn on, turn off), but your desktop radio might have additional states (on, off, current volume, current station) and behavior (turn on, turn off, increase volume, decrease volume, seek, scan, and tune). You may also notice that some objects, in turn, will also contain other objects. These real-world observations all translate into the world of object-oriented programming.
By using this object we are following some software Mechanism.It as,

          Abstraction
          Inheritence
          Encapsulation
          Interface
          Polymorphism
            » Overriding
            » Overloading

Real Time Example: Bicycle.

     Software objects are conceptually similar to real-world objects: they too consist of state and related behavior. An object stores its state in fields (variables in some programming languages) and exposes its behavior through methods (functions in some programming languages). Methods operate on an object's internal state and serve as the primary mechanism for object-to-object communication. Hiding internal state and requiring all interaction to be performed through an object's methods is known as data encapsulation — a fundamental principle of object-oriented programming.



By attributing state (current speed, current pedal cadence, and current gear) and providing methods for changing that state, the object remains in control of how the outside world is allowed to use it. For example, if the bicycle only has 6 gears, a method to change gears could reject any value that is less than 1 or greater than 6.
All Rights Reserved : skdotcom technologies