Computer Science > EXAM > COMP 401 Midterm Exam 2. Spring 2021. University of North Carolina (All)
COMP 401 Midterm Exam 2. Spring 2021. University of North Carolina.I have not received nor given any unauthorized assistance in completing this exam. Signature: Name: PID: ... This page intentionally left blank. Part I: True or False 30 questions, 1 points each, 30 points total. The for (Object o : iterable) construct only works for built-in arrays and ArrayLists. Subinterfaces are an example of inheritance. A subinterface can override methods specified in its parent interface. A class that implements a subinterface has an "is-a" relationship with the parent interface. A class must explicitly specify that it is implementing both a subinterface and its parent interface. All methods in the parent interface must also be specified in the subinterface. A class that implements a subinterface must be extended from a class that implements the parent interface. Only subclasses can implement subinterfaces. A subclass inherits both public and protected instance variables from the parent class. A subclass can directly access private instance variables declared in the parent class. A method defined by a subclass is unable to invoke a private method defined in the parent class. A subclass can not specify methods not already specified in the parent class. Subclassing is useful for extending existing classes with new behavior. The implementation of an overriding method in the subclass must have the same method signature as a method defined in the parent class. A subclass constructor can use super to explicitly invoke a constructor of its parent class. A call to super can be invoked anywhere within a subclass constructor. A subclass constructor can invoke any method of the parent class by using super. In an overriding method, super can be used to invoke the same method as specified in the parent class. All overriding methods in Java are virtual. A finally block will not be called unless an exception occurs. Within a try-catch-finally construct, the finally block will execute even if a return statement is encountered. [Show More]
Last updated: 3 years ago
Preview 1 out of 15 pages
Buy this document to get the full access instantly
Instant Download Access after purchase
Buy NowInstant download
We Accept:
Can't find what you want? Try our AI powered Search
Connected school, study & course
About the document
Uploaded On
Sep 30, 2021
Number of pages
15
Written in
All
This document has been written for:
Uploaded
Sep 30, 2021
Downloads
0
Views
95
Scholarfriends.com Online Platform by Browsegrades Inc. 651N South Broad St, Middletown DE. United States.
We're available through e-mail, Twitter, Facebook, and live chat.
FAQ
Questions? Leave a message!
Copyright © Scholarfriends · High quality services·