placeholder image to represent content

Unit 2 Vocab- AP CSA

Quiz by Katherine Valenti

Our brand new solo games combine with your quiz, on the same screen

Correct quiz answers unlock more play!

New Quizalize solo game modes
24 questions
Show answers
  • Q1
    What 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
  • Q2
    What 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
  • Q3
    Which 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
  • Q4
    What 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
  • Q5
    What 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
  • Q6
    What 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
  • Q7
    What does the 'this' keyword refer to?
    The next object in sequence
    The current object or instance
    The previous object in sequence
    A reserved word in programming
    30s
  • Q8
    What is the purpose of using super() in a subclass constructor?
    To access private members of the parent class
    To prevent the subclass from inheriting from the parent class
    To override a method in the parent class
    To create a new instance of the subclass
    To call the constructor of the parent class
    30s
  • Q9
    Which keyword is used to create a subclass in Java?
    extends
    super
    implements
    inherits
    sub
    30s
  • Q10
    What is the purpose of constructor overloading in object-oriented programming?
    To provide multiple ways to initialize an object
    To restrict access to class members
    To hide the implementation details of a class
    To create a hierarchy of classes
    To enable dynamic binding of methods
    30s
  • Q11
    Which of the following is an example of a variable?
    x = 5
    function call
    if statement
    for loop
    30s
  • Q12
    What is the purpose of a variable?
    To perform calculations
    To display output
    To store and manipulate data
    To control program flow
    30s
  • Q13
    What is the purpose of initializing a variable?
    To assign a random value to a variable
    To declare a variable's data type
    To create a new variable
    To assign an initial value to a variable
    30s
  • Q14
    What is the scope of a variable?
    The size of the variable in memory
    The data type of the variable
    The area of a program where the variable is accessible
    The number of times the variable can be accessed
    30s
  • Q15
    What 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

Teachers give this quiz to your class