COMP 2710 Lecture Notes - Reserved Word

43 views2 pages

Document Summary

Ch 9 inheritance: do not put super class instance variables, in subclass, you would create a second copy any method can be overloaded or overridden calls the constructor top down, superclass then subclass. Question class constructor text = ; answer = ; Choicequestion constructor choices = new arraylist (); Choicequestion q1 = new choicequestion (); q1 has: is of type: choicequestion text = ; answer = ; choices = arraylist. If question is deleted: q1 has: is of type: choicequestion text = null; answer = null; choices = arraylist. If choicequestion is deleted: q1 has: is of type: choicequestion text = ; answer = ; choices = null; If both are deleted all varibiables are null. If you prefer to call a more specific constructor, you can invoke it by replacing the superclass name with the reserved word super followed by ();

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents

Related Questions