COIS 2020H Lecture Notes - Lecture 1: Abstract Type, Object Copying, Jagged Array
Document Summary
In fraction class data are encapsulated as integer and inter denominator. Inside a class we write the data member or field. A parent class allows the method to be overwritten by a descendant class. A child class is dependent of its parent class and it usually involves a cast. An abstract method has no body an abstract class also allows the method t o be overwritten by a descendent class. An inheritance permits a descendant class to inherit the behaviour of its parent class. All methods in an interface are public and abstract. There are a few methods relating to interface class. A class can only have one parent class. A child class exhibits at least the same behaviour as its parent class. A class must implement all methods defined in the interface. A class may defer implementing the body of an abstract method in the parent class; hence, the descendant class is also abstract.