COMP SCIStudy Guide Test 3

COMP SCIStudy Guide Test 3 - Study Guide Test 3 *...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Study Guide Test 3 * Definition of terms in OOP: abstraction, encapsulation, information hiding, inheritance, polymorphism the object Lassie is an instance of the Dog class. The set of values of the attributes of a particular object is called its state .The object consists of state and the behaviour that's defined in the object class. "The process by which an object sends data to another object or asks the other object to invoke a method." [1] Also known to some programming languages as interfacing I nheritance- "Subclasses" are more specialized versions of a class, which inherit attributes and behaviors from their parent classes, and can introduce their own. Only need to write code inherited from super class once. Each subclass can alter its inherited traits. In fact, inheritance is an "is-a" relationship: Lassie is a Collie . A Collie is a Dog. Inheritance is the capability of a class to use the properties and methods of another class while adding its own functionality. The concept of inheritance greatly enhances the ability to reuse code as well as making design a much simpler and cleaner process. Superclass & subclass Encapsulation- conceals the functional details of a class from objects that send messages to it. Encapsulation is achieved by specifying which classes may use the members of an object. The result is that each object exposes to any class a certain interface those members accessible to that class. The reason for encapsulation is to prevent clients of an interface from depending on those parts of the implementation that are likely to change in future, thereby allowing those changes to be made more easily, that is, without changes to clients. Encapsulation is the ability of an object to be a container (or capsule) for related properties (ie. data variables) and methods. I nformation H iding- is the ability of objects to shield variables from external access. These private variables can only be seen or modified by use of object accessor and mutator methods. This permits validity checking at run time. Access to other object variables can be allowed but with tight control on how it is done. Methods can also be completely hidden from external use. Those that are made visible externally can only be called by using the object's front door Polymorphism- is the capability of an action or method to do different things based on the object that it is acting upon. This is the third basic principle of object oriented programming. Overloading and overriding are two types of polymorphism. Polymorphism is the ability of objects belonging to different data types to respond to method calls of methods of the same name, each one according to an appropriate type-specific behavior....
View Full Document

This homework help was uploaded on 04/16/2008 for the course CS 303e taught by Professor Mitra during the Fall '07 term at University of Texas at Austin.

Page1 / 5

COMP SCIStudy Guide Test 3 - Study Guide Test 3 *...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online