Discussion 4
Discussion 4
Christine Zhou
Agenda
Announcements
Review
… ...
} }
constructor() { constructor() {
this.hello = 10; super();
}
this.hello = 10;
}
● These are equivalent!
constructor() { constructor() {
this.hello = 10; super(10);
}
this.hello = 10;
}
● These are not equivalent!
Overloaded vs. Overridden
public class Fish { public class Goldfish
extends Fish {
…
...
public void bloop() {} public void
bloop() {}
} }
● Example of overridden methods! bloop in both the Goldfish and Fish
class
● Usually use “@Override” right above the method for clarity