AP Computer Science A - Review 1, Questions and answers, rated A+/ / latest Exam prediction paper 2024/25 APPROVED/
AP Computer Science A - Review 1, Questions and answers, rated A+ Inheritance defines a relationship between _______ that share characteristics - - objects Inheritance is when a new class (_______) is created from an existing class (_______) - -subclass, superclass The subclass _______ characteristics of its superclass - -inherits When methods of superclasses are overwritten by subclasses - -Method overriding If part of the original method implementation from the superclass is retained, the rewrite is referred to as _______ - -Partial overriding To specify the inheritance relationship between a subclass and a superclass, in the declaration of the subclass, use the keyword _______ - -extends ex: public class Subclass _______ Superclass {} - -extends Are private instance variables of a superclass directly accessible to its subclasses? - -No Can subclasses directly invoke the public accessor and mutator methods of the superclass? - -Yes A method in a superclass is overriden in a subclass by defining a method with same _______ - -return type and signature (name and parameter types) _______ are never inherited - -Constructors A superclass must have a default, zero-parameter _______ - -Constructor A subclass constructor can be implemented with a call to the _______ - -super method (super();) If super is used in the implementation of a subclass constructor, it must be used in the _______ of the constructor body - -first line If no constructor is provided in the subclass, it calls the default constructor of the _______ - -superclass The mechanism of selecting the appropriate method for a particular object in a class hierarchy - -Polymorphism A method that has been overridden in at least one subclass is said to be _______ - - polymorphic Method calls are always determined by the type of the _______, not the type of the object reference - -actual object Making a run-time decision about which instance method to call is known as _______ - -Dynamic binding (late binding) When the compiler selects the correct overloaded method at compile time by comparing the methods' signatures - -Overloading When the actual method that will be called is not determined by the compiler, instead the compiler only determines if a method can be called, while the run-time environment determines how it will be called - -Dynamic binding _______ applies only to overridden methods in subcla
Written for
- Institution
- AP Computer Science A
- Course
- AP Computer Science A
Document information
- Uploaded on
- February 3, 2024
- Number of pages
- 5
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
ap computer science a review 1 questions and a