notes2 - Object-Oriented Programming Concepts • Real...

Object-Oriented Programming Concepts • Real world objects include things like your car, TV etc. These objects share two characteristics: they all have state and they all have behavior. • Software objects are modeled after real-world objects in that they, too, have state and behavior. A software object maintains its state in variables and implements its behavior with methods. • In an OO language like Java or C++, the basic building block is the object , an entity that has its own data (variables) and its own methods for manipulating that data and interacting with other objects. • OOP refers to the art of decomposing an application into some number of objects that work together. An Object Methods Variables • For e.g., a Circle object would need to describe its center (x and y coordinates) and its radius. This object must also be able to set its center coordinates or its radius, and report its radius to other object.

This
preview
has intentionally blurred sections.
Sign up to view the full version.