Worksheets2025-Q2-CP2-3RD-ASSESSMENT-VOCABULARY
Total questions: 22
Worksheet time: 11mins
In a class representing students, what is the primary role of an Instance Variable if Santi and Sarina each have their own unique student ID?
To store the state or data unique to each object
To define a block of executable code inside the class
To protect data by keeping methods private
To initialize objects when they are created
Pramod and Sarina are designing a class for a library system. When they decide what information each book object needs to remember, they are defining the:
Public interface
Mutator methods
Instance variables
Return values
Parthiv and Isha are learning about classes in their programming class. They discuss that instance variables, along with the bodies of constructors and methods, form what part of a class?
The public interface
The tester class
The documentation comment
The private implementation
Swayam and Sarina are learning about programming. When they create a new object in their code, what is the main function of a Constructor?
To perform calculations on object data
To initialize the instance variables of a newly created object
To determine the visibility of variables
To permanently delete the object from memory
Parthiv and Ash are discussing programming. Parthiv asks, "Which characteristic distinguishes a Constructor from a regular Method?"
A constructor must return a value, while a method does not
A constructor shares the same name as the class and has no return type
Constructors are always private, and methods are always public
Methods are called using the new keyword, constructors are not (Los métodos se llaman usando la palabra clave new, los constructores no)
When Jack creates a new object in his program using the new keyword, when is the Constructor automatically called during program execution?
When a method is invoked on an existing object
When a new object is created using the new keyword
When an instance variable is declared as private
When the program starts its main method
Sarina is learning about object-oriented programming. She asks her friend Kensley, "What is the definition of a Method in object-oriented programming?" What should Kensley answer?
A variable that stores the state for each object
A set of public constructors that can be called
A block of code inside a class that performs an action or returns information
The process of initializing data when an object is created
Srivalli and Drew are learning programming. Srivalli creates a class called Car, and then Drew creates his own Car with a unique color and license plate using that class. In this scenario, what is Drew's Car in programming?
A blueprint defining the data and behaviors (Un plano que define los datos y comportamientos)
The private keyword used for instance variables (La palabra clave privada utilizada para las variables de instancia)
A specific instance created from a class, possessing its own unique data (Una instancia específica creada a partir de una clase, que posee sus propios datos únicos)
A special method used for initialization (Un método especial utilizado para la inicialización)
Matthew and Isabel are learning about programming. Their teacher explains that there is a blueprint in programming that defines the data and behaviors that its instances will possess. What term describes this blueprint?
Object reference (Referencia de objeto)
Class (Clase)
Instance variable (Variable de instancia)
Mutator (Mutador)
Maximo is designing a class to store student grades. He wants to protect the grades from being changed directly by others. Encapsulation is described as protecting data by doing what?
Making all methods private and all variables public
Ensuring the class contains a no-argument constructor
Keeping instance variables private and controlling access through public methods
Running a separate tester class to check results
Matthew is designing a BankAccount class for a banking app. Why should the balance instance variable in the BankAccount class typically be declared as private?
To allow the constructor to initialize it easily
To enforce encapsulation and prevent external code from directly modifying the data
Because private variables run faster than public variables
To hide the class from the tester program
Kensley has a class representing a BankAccount. She wants to check the current balance without changing any data. What is the purpose of an Accessor method in this scenario?
To update the internal state of the object
To return information about the object without changing its stored data
To create and initialize a new object
To locate and fix errors in the program
Kensley has created a BankAccount class for a school project. The getBalance() method in Kensley's BankAccount class is an example of what type of method?
Mutator method
Accessor method
Constructor method
Private method
14. Parthiv está programando una clase CuentaBancaria y quiere permitir que el saldo se actualice de manera segura. ¿Cuál es el rol de un método Mutador, o método setter, en este caso?
Permitir modificar el valor de un atributo privado de una clase.
Obtener el valor de un atributo privado de una clase.
Eliminar un atributo de una clase.
Crear una nueva instancia de una clase.
Sarina uses the deposit(double amount) method to add money to her BankAccount, which changes the internal balance. This method is categorized as what type of method?
Mutator (Mutador)
Accessor (Accesor)
Constructor (Constructor)
Public interface (Interfaz pública)
Sarina and Drew are designing a class for a library system. They want to know: What exactly constitutes the Public Interface of their class? (¿Qué constituye exactamente la Interfaz Pública de una clase?)
The private instance variables and their associated accessor methods (Las variables de instancia privadas y sus métodos accesores asociados)
The set of public constructors and public methods that other code is permitted to call (El conjunto de constructores públicos y métodos públicos que otro código tiene permitido llamar)
The implementation details hidden from the user (Los detalles de implementación ocultos al usuario)
The documentation comments generated by javadoc (Los comentarios de documentación generados por javadoc)
Jack and Parthiv are working on a new software project. What is the main job of a Tester Class in their project?
To automatically compile the source code
To construct objects of the class being tested, invoke methods, and check results
To store the private instance variables in a file
To define the graphical user interface
Matthew and Sarina are using a Tester Class to unit test their new calculator application. What is the final essential step they should perform during this process?
Declaring all instance variables as private
Implementing the constructor logic
Invoking the methods and checking the results
Defining the graphical user interface
Jack and Isha are working together on a coding assignment. They decide to carefully go through their program step-by-step to observe how variables and object states change as the code runs. What is this process called?
Debugging (Depuración)
Initialization (Inicialización)
Tracing (Trazado)
Encapsulation (Encapsulación)
Srivalli and Swayam are working together on a programming project. They encounter an issue where their code isn't producing the expected results. What is the definition of Debugging in this context? (¿Cuál es la definición de Depuración en el contexto de la comprensión de la programación?)
Defining a class's public interface (Definir la interfaz pública de una clase)
Using a class's methods to carry out meaningful tasks (Usar los métodos de una clase para llevar a cabo tareas significativas)
Utilizing tools (like an IDE) to step through a program and troubleshoot or find and fix errors (Utilizar herramientas (como un IDE) para recorrer un programa y solucionar problemas o encontrar y corregir errores)
Generating formatted HTML documentation from comments (Generar documentación HTML formateada a partir de comentarios)
Srivalli buys a new smartphone. What is the goal of Initialization in relation to the smartphone as an object? (¿Cuál es el objetivo de la Inicialización en relación con los objetos, como el smartphone de Srivalli?)
Setting the initial value for an object's instance variable upon creation (Establecer el valor inicial para la variable de instancia de un objeto al crearlo)
Defining the public methods that access private data (Definir los métodos públicos que acceden a datos privados)
Calling an accessor method to retrieve data (Llamar a un método accesor para recuperar datos)
Comparing the actual program output to the predicted output (Comparar la salida real del programa con la salida prevista)
Matthew is writing a method declaration: public void processOrder(int quantity, double price). In this method, quantity and price are examples of:
Instance variables (Variables de instancia)
Parameters (Parámetros)
Object references (Referencias de objeto)
Return values (Valores de retorno)
