IAT 167 Lecture 5: IAT167-Week 5 Lecture 2.docx

47 views2 pages

Document Summary

The ability of an object to be a container for properties (data) and methods. The ability of an object to hide and restrict access to internal properties and methods. Accessor functions allow class consumers to read internal variables. Mutator functions allow class consumers to change internal variables. Object { public var x:int; public var y:int; public function show(); Access a class variable via functions but as if directly. Allows you to put conditions on when getting and setting is allowed. The capability of a class to use the properties and methods of another class (its superclass) while adding its own functionality (the subclass) Example class wheel{ var hub; var spokes; var rim; function roll(); class rearwheel extends wheel { var gears; function pedal(); The capability of an action or method to do different things based on the object that it is acting upon. Example public class animalreference public static void main(string args[])