CS 18000 Lecture 23: CS180 10:21:16

21 views2 pages

Document Summary

Cs180 10/21/16: reminder: java access modi ers, can apply to members: elds and methods, modi ers control access to members from methods in other classes. This list is from least to most restrictive: public, protected, [none], private: subclass access, subclasses cannot access private elds in their superclasses. It is possible to determine if an object is of a particular class (or subclass) (objecta instance classb: evaluates true if the object referenced by objecta ia an instance of the class. Classb: ex: (student1 instanceof student) is true, ex: (student1 instanceof person) is true. Interface syntax: a class-like declaration interface doable { _ , exists in own le. It also provides a code body: every class that implements the interface inherits the interface"s default methods but can override them. Implementing an interface: classes may declare that they implement an interface, must have at least what is mentioned in the interface, can have more. Implementing multiple interfaces: a class can implement multiple interfaces.

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