ITM 200 Lecture : Chapter 11

95 views5 pages

Document Summary

objects are unique and can be distinctly identified. an object has a unique identity, state, behavior: state: data field (radius = 1), a variable, behavior: set of methods (getarea (), getperimeter ()) classes are constructs that define objects of the same type. a constructor with no parameters is referred to as a no-arg constructor. does not return value no void. Circle mycircle = new circle(5. 0: circle: data type, mycircle: object name, new: creating a new object, circle: calling the constructor. when using this, there has to be a constructor made. Circle www. notesolution. com radius: double numberofobjects: int getnumberofobjects(): int. Circle c (object type) c is of type circle. Instance methods are invoked by an instance of the class: static - variables, constants & methods. static variables are shared by all the instances of the class. static methods are not tied to a specific object.