QDBordtoshred / WEni

MIT License
0 stars 0 forks source link

MCQ #12

Open QDBordtoshred opened 8 months ago

QDBordtoshred commented 8 months ago
MCQ Score Improvements
36/40 superclass
Subclass
image image

Methods of the superclass can be overridden in the subclass. Since the books array is declared of type Book, the compiler will check to see if Book has a length() method. Since Book has a length() method, there is not a compile time error. At run-time, the length() method in AudioBook will be executed since the object at books[0] is an AudioBook.

image

List is an interface, which an ArrayList implements. Please note that List is no longer tested as part of the AP CSA exam and ArrayList will be used instead. This would be the case if the loop condition was k > 1 rather than k > 0.

image

Please note that interface is no longer a part of the AP CSA exam. Choice II provides the user with methods smallerHeight, smallerWidth, and smallerDepth that let the user know if one box is smaller than the other in each of the three dimensions.

image

This expression will evaluate to false if y is less than 10000 regardless of whether x is in the correct range between 1000 and 1500. The expression will evaluate to false if x is not in the range between 1000 and 1500 even if y is greater than 10000.


Superclass: Also known as a parent class or base class, it is the class whose properties and methods are inherited by another class. The superclass serves as a general template.

Subclass: Also known as a child class or derived class, it is the class that inherits properties and methods from another class. The subclass can also have additional or overridden features compared to its superclass.


ArrayList: It is part of the Java Collections Framework and provides dynamic array functionality. It automatically resizes itself when the number of elements exceeds its capacity. LinkedList: Implements a doubly-linked list, which allows for efficient insertion and deletion of elements but may have higher overhead compared to ArrayList.