CS 2110 Lecture 6: Types and Their consequences, instanceof

25 views4 pages

Document Summary

Lecture 6 - types and their consequences, instanceof. Given a method/class/anything inside some other class/method/anything, the outer thing has access to any component inside it. Values of linked lists are probably of class object. What does the mean? whatever type can be added to the list! You put in integer or string or. This creates an array with 3 elements, each whose type must be animal. The array is also of type animal[] Stores a new object type of animal at index 0 in array v. Can call methods on these objects still. We have two variables that point towards the same object. For both objects, we still must use the bottom up rule! You cannot call a method that is not available in either animal or one of its superclasses. Suppose a refers to an object of. Rule for determining legality of method call.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents