
Unit 2 Vocab- AP CSA
Quiz by Katherine Valenti
Feel free to use or edit a copy
includes Teacher and Student dashboards
Measure skillsfrom any curriculum
Measure skills
from any curriculum
Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
With a free account, teachers can
- edit the questions
- save a copy for later
- start a class game
- automatically assign follow-up activities based on students’ scores
- assign as homework
- share a link with colleagues
- print as a bubble sheet
24 questions
Show answers
- Q1What is an attribute?A logical statement that evaluates to either true or false.A characteristic or property of an object or data element.A group of instructions that are executed sequentially.A function that performs a specific task.30s
- Q2What is the purpose of a no-argument constructor ?To create an object with default values.To initialize all instance variables.To access private methods.To overload a method.30s
- Q3Which of the following statements regarding no-argument constructors is true?They have the same name as the class.They are used to pass arguments to methods.They are automatically inherited from a superclass.30s
- Q4What is a constructor?A loop that repeats a block of code a fixed number of times.A keyword used to define a data type in programming languages.A variable that holds the memory address of an object.A special method that is used to initialize objects of a class.30s
- Q5What is a parameterized constructor?A constructor that creates multiple instances of a class.A constructor that defines the behavior of an object when it is destroyed.A constructor that sets default values for object properties.A constructor that accepts arguments to initialize object properties.30s
- Q6What is constructor overloading?Defining constructors that can be accessed by any object in a program.Creating constructors with the same name but different return types.Having multiple constructors with identical signatures in a class.Having multiple constructors with different parameters in a class.30s
- Q7What does the 'this' keyword refer to?The next object in sequenceThe current object or instanceThe previous object in sequenceA reserved word in programming30s
- Q8What is the purpose of using super() in a subclass constructor?To access private members of the parent classTo prevent the subclass from inheriting from the parent classTo override a method in the parent classTo create a new instance of the subclassTo call the constructor of the parent class30s
- Q9Which keyword is used to create a subclass in Java?extendssuperimplementsinheritssub30s
- Q10What is the purpose of constructor overloading in object-oriented programming?To provide multiple ways to initialize an objectTo restrict access to class membersTo hide the implementation details of a classTo create a hierarchy of classesTo enable dynamic binding of methods30s
- Q11Which of the following is an example of a variable?x = 5function callif statementfor loop30s
- Q12What is the purpose of a variable?To perform calculationsTo display outputTo store and manipulate dataTo control program flow30s
- Q13What is the purpose of initializing a variable?To assign a random value to a variableTo declare a variable's data typeTo create a new variableTo assign an initial value to a variable30s
- Q14What is the scope of a variable?The size of the variable in memoryThe data type of the variableThe area of a program where the variable is accessibleThe number of times the variable can be accessed30s
- Q15What is the difference between local and global variables?Local variables are declared within a specific function or block, while global variables are declared outside any function and can be accessed throughout the entire program.Local variables have a shorter lifespan than global variables, which exist throughout the entire program.Local variables are used for storing strings, while global variables are used for storing numbers.Local variables are used for input, while global variables are used for output.30s