CSCB07H3 Lecture 8: Lecture 8 Note
Document Summary
Announcement: lab 1,2: to be granted this week. Declares a function in java: includes visibility modi er, includes the type of the return value: a) void: nothing is returned, includes types of all parameters. In general: getter is better than acquires internal variables. Constructor: if no constructor is manually de ned, then a constructor with no argument is implicitly de ned, a constructor in a child class always calls a constructor in a parent class. If the call is not speci ed, it implicitly calls a constructor with no arguments. a) solution 1: create another constructor in person. b) solution 2: call the parent constructor instead of using setters.