Test
Java + OOP Fundamentals
Este test tiene tipos de pregunta que se abren en el reproductor de siempre.
Preguntas del test (43)
1[Java] What is an Array List?
- AA dynamic array that maintains insertion order and is indexed.
- BA collection that utilizes nodes to store data in non-consecutive memory locations. Each node has data, and pointers to its next and prev node.
- CA collection that is unordered and operates on key-value pairs. Keys must be unique, but values do not.
- DA form of map that uses hashcode() to determine the index location for keys.
- EA collection that is unordered, has no indices, and does not allow duplicate values.
2[Java] What is a Linked List?
- AA dynamic array that maintains insertion order and is indexed.
- BA collection that utilizes nodes to store data in non-consecutive memory locations. Each node has data, and pointers to its next and prev node.
- CA collection that is unordered and operates on key-value pairs. Keys must be unique, but values do not.
- DA form of map that uses hashcode() to determine the index location for keys.
- EA collection that is unordered, has no indices, and does not allow duplicate values.
3[Java] What is a Map?
- AA dynamic array that maintains insertion order and is indexed.
- BA collection that utilizes nodes to store data in non-consecutive memory locations. Each node has data, and pointers to its next and prev node.
- CA collection that is unordered and operates on key-value pairs. Keys must be unique, but values do not.
- DA form of map that uses hashcode() to determine the index location for keys.
- EA collection that is unordered, has no indices, and does not allow duplicate values.
4[Java] What is a Hash Map?
- AA dynamic array that maintains insertion order and is indexed.
- BA collection that utilizes nodes to store data in non-consecutive memory locations. Each node has data, and pointers to its next and prev node.
- CA collection that is unordered and operates on key-value pairs. Keys must be unique, but values do not.
- DA form of map that uses hashcode() to determine the index location for keys.
- EA collection that is unordered, has no indices, and does not allow duplicate values.
5[Java] What is a Set?
- AA dynamic array that maintains insertion order and is indexed.
- BA collection that utilizes nodes to store data in non-consecutive memory locations. Each node has data, and pointers to its next and prev node.
- CA collection that is unordered and operates on key-value pairs. Keys must be unique, but values do not.
- DA form of map that uses hashcode() to determine the index location for keys.
- EA collection that is unordered, has no indices, and does not allow duplicate values.
6What is encapsulation?
- AWrapping related data[state and behavior] into classes to control modification and access.
- BThe ability for the behavior of a method to change based on its context.
- COnly showing what needs to be shown; i.e. a class inheriting from another class only needs to be able to have a parent method called from an instance of it, it doesn't need to have it instantiated within itself.
- DWhen a class has access to the data within a parent class.
7What is polymorphism?
- AWrapping related data[state and behavior] into classes to control modification and access.
- BThe ability for the behavior of a method to change based on its context.
- COnly showing what needs to be shown; i.e. a class inheriting from another class only needs to be able to have a parent method called from an instance of it, it doesn't need to have it instantiated within itself.
- DWhen a class has access to the data within a parent class.
8What is abstraction?
- AWrapping related data[state and behavior] into classes to control modification and access.
- BThe ability for the behavior of a method to change based on its context.
- COnly showing what needs to be shown; i.e. a class inheriting from another class only needs to be able to have a parent method called from an instance of it, it doesn't need to have it instantiated within itself.
- DWhen a class has access to the data within a parent class.
9What is inheritance?
- AWrapping related data[state and behavior] into classes to control modification and access.
- BThe ability for the behavior of a method to change based on its context.
- COnly showing what needs to be shown; i.e. a class inheriting from another class only needs to be able to have a parent method called from an instance of it, it doesn't need to have it instantiated within itself.
- DWhen a class has access to the data within a parent class.
10How do we perform encapsulation?
- AVia keeping member variables private, and using getters + setters to access and modify them.
- BVia method overriding and overloading.
- CVia inheritance and not reusing code amongst related classes needlessly.
- DVia interfaces, abstract classes, and using child classes to implement/extend from parent classes.
11How do we perform polymorphism?
- AVia keeping member variables private, and using getters + setters to access and modify them.
- BVia method overriding and overloading.
- CVia inheritance and not reusing code amongst related classes needlessly.
- DVia interfaces, abstract classes, and using child classes to implement/extend from parent classes.
12How do we perform abstraction?
- AVia keeping member variables private, and using getters + setters to access and modify them.
- BVia method overriding and overloading.
- CVia inheritance and not reusing code amongst related classes needlessly.
- DVia interfaces, abstract classes, and using child classes to implement/extend from parent classes.
13How do we perform inheritance?
- AVia keeping member variables private, and using getters + setters to access and modify them.
- BVia method overriding and overloading.
- CVia inheritance and not reusing code amongst related classes needlessly.
- DVia interfaces, abstract classes, and using child classes to implement/extend from parent classes.
14[Java] Interfaces can have both abstract and regular methods.
- AVerdadero
- BFalso
15[Java] Abstract classes can have both abstract and regular methods.
- AVerdadero
- BFalso
16Method overriding
- AWhen a child class creates its own version of a parent class's method.
- BWhen there are multiple methods of the same name in the same class, but their parameters [whether in number or in data type] are different.
17Method overloading
- AWhen a child class creates its own version of a parent class's method.
- BWhen there are multiple methods of the same name in the same class, but their parameters [whether in number or in data type] are different.
18Coupling
- AA measure of how many dependencies a class has on other classes.
- BA measure of how many different tasks a class performs.
19Cohesion
- AA measure of how many dependencies a class has on other classes.
- BA measure of how many different tasks a class performs.
20Low cohesion
- AA class performs many different things
- BA class is focused on a specific set of tasks
- CA class is dependent on a few classes
- DA class is dependent on many classes
21High cohesion
- AA class performs many different things
- BA class is focused on a specific set of tasks
- CA class is dependent on a few classes
- DA class is dependent on many classes
22Low coupling
- AA class performs many different things
- BA class is focused on a specific set of tasks
- CA class is dependent on a few classes
- DA class is dependent on many classes
23High coupling
- AA class performs many different things
- BA class is focused on a specific set of tasks
- CA class is dependent on a few classes
- DA class is dependent on many classes
24What is a factory?
- AA design pattern in which a class is used to instantiate objects. Has one general class/interface with a bunch of child objects. Decouples your code; rather than your main class having to depend on all these child objects, it just depends on this.
- BA design pattern in which a class has one entity [typically a thread] that makes/receives data to be used, and one entity [also typically a thread] that processes/manages/manipulates said data.
- CA design pattern in which a class can only have ONE instance of itself. Useful when working with threads, since it ensures every thread is using the same object.
25What is a producer/consumer pattern?
- AA design pattern in which a class is used to instantiate objects. Has one general class/interface with a bunch of child objects. Decouples your code; rather than your main class having to depend on all these child objects, it just depends on this.
- BA design pattern in which a class has one entity [typically a thread] that makes/receives data to be used, and one entity [also typically a thread] that processes/manages/manipulates said data.
- CA design pattern in which a class can only have ONE instance of itself. Useful when working with threads, since it ensures every thread is using the same object.
26What is a singleton?
- AA design pattern in which a class is used to instantiate objects. Has one general class/interface with a bunch of child objects. Decouples your code; rather than your main class having to depend on all these child objects, it just depends on this.
- BA design pattern in which a class has one entity [typically a thread] that makes/receives data to be used, and one entity [also typically a thread] that processes/manages/manipulates said data.
- CA design pattern in which a class can only have ONE instance of itself. Useful when working with threads, since it ensures every thread is using the same object.
27[Java] Select the option that reads in data from an input stream and writes it to a file correctly.
- Aint byteData;
while ((byteData = inputStream.read()) != -1 {
outputStream.write(byteData);
} - Bwhile (inputStream.nextByte() != 0) {
outputStream.write(inputStream.nextByte());
}
- Aint byteData;
28What is the main difference between the JVM, JRE, and JDK in Java?
- AThe JVM contains the JDK and JRE, and it handles compiling and packaging Java code into executable files.
- BThe JVM provides tools for developing Java programs, while the JDK is responsible for running them, and the JRE compiles source code into bytecode
- CThe JRE and JDK are identical, but the JVM is only used for debugging Java programs
- DThe JDK includes tools for developing and running Java programs, it includes the JRE and JVM themselves. The JRE provides the environment to run said programs, and the JVM executes the compiled bytecode.
29What is the JDK [Java Development Kit]/what does it contain? Note: Do not select things that fall under the JRE and JVM, if those fall within the JDK.
- AContains all tools needed to run Java code
- BThe code the programmer has written
- CCompiler
- DDebugger
- EVerifies bytecode
- FJRE
- GJVM
- HDynamically loads libraries and classes
- ILoads and executes bytecode, interpreting it into machine code so its machine agnostic
- JThe heap
30What is the JRE [Java Runtime Environment]/what does it contain? Note: Do not select things that fall under the JDK and JVM, if those fall within the JRE.
- AContains all tools needed to run Java code
- BCompiler
- CDebugger
- DVerifies bytecode
- EJDK
- FJVM
- GDynamically loads libraries and classes
- HLoads and executes bytecode, interpreting it into machine code so its machine agnostic
- IThe heap
- JThe stack
31What is the JVM [Java Virtual Machine]/what does it contain? Note: Do not select things that fall under the JDK and JRE, if those fall within the JVM.
- AContains all tools needed to run Java code
- BCompiler
- CDebugger
- DJDK
- EJVM
- FDynamically loads libraries and classes
- GLoads and executes bytecode, interpreting it into machine code so its machine agnostic
- HThe heap
- IThe stack
- JThe code the programmer wrote
32Label the diagram for how memory management is performed in Java

- ACode
- BCompiler
- CDebugger
- DJDK
- EJRE
- FJVM
- GBytecode
33Select the features of the heap
- AManages objects and JRE classes
- BHierarchical memory management [Organized as a red-black tree]
- CHas the garbage collector, which does mark & sweep [When adding an object, it’s marked with a 0 by default. If accessible, the garbage collector changes that to a 1. If an obj is deleted [ie no longer reachable], it’s now marked as 0 and removed.]
- DManages methods, local variables, and reference variables
- EMemory managed linearly LIFO style
- F1 heap per thread, so there CAN be multiple heaps
- GWhen a method is called, it's added to the heap. Once it's done, it's removed from the heap.
34Select the features of the stack
- AManages objects and JRE classes
- BHierarchical memory management [Organized as a red-black tree]
- CHas the garbage collector, which does mark & sweep [When adding an object, it’s marked with a 0 by default. If accessible, the garbage collector changes that to a 1. If an obj is deleted [ie no longer reachable], it’s now marked as 0 and removed.]
- DManages methods, local variables, and reference variables
- EMemory managed linearly LIFO style
- F1 stack per thread, so there CAN be multiple stacks
- GWhen a method is called, it's added to the stack. Once it's done, it's removed from the stack.
35What does a 'thread-safe' version of something ensure?
- AIt ensures that it will not terminate threads that touch it
- BIt ensures that there is synchronicity across all threads touching it
- CIt ensures that threads that touch it will not change its value
36[Java] What does the volatile keyword do?
- AAllows other threads to manipulate the instance variable even when currently being altered, so that its value is synced across threads. Can only be used on fields.
- BKeeps the variable the same across all instances of a class by creating only 1 reference of it in memory, rather than 1 reference per instance. Can be used for fields and methods.
- C"All or none". Only the entire process occurs start-to-finish, or it doesn't happen at all. Can be used for fields and methods.
37[Java] What does the static keyword do?
- AAllows other threads to manipulate the instance variable even when currently being altered, so that its value is synced across threads. Can only be used on fields.
- BKeeps the variable the same across all instances of a class by creating only 1 reference of it in memory, rather than 1 reference per instance. Can be used for fields and methods.
- C"All or none". Only the entire process occurs start-to-finish, or it doesn't happen at all. Can be used for fields and methods.
38What does the atomic version of a value do?
- AAllows other threads to manipulate the instance variable even when currently being altered, so that its value is synced across threads. Can only be used on fields.
- BKeeps the variable the same across all instances of a class by creating only 1 reference of it in memory, rather than 1 reference per instance. Can be used for fields and methods.
- C"All or none". Only the entire process occurs start-to-finish, or it doesn't happen at all. Can be used for fields and methods.
39What is Test Driven Development?
- AWriting tests to cover every scenario that could run through your program, both alongside the rest of development, before, and afterwards.
- BWriting tests to cover every scenario that could run through your program before developing the code to which those tests will apply.
- CThe practice of testing the smallest chunks of an application as possible in isolation from the rest of the program.
40What is unit testing?
- AWriting tests to cover every scenario that could run through your program, both alongside the rest of development, before, and afterwards.
- BWriting tests to cover every scenario that could run through your program before developing the code to which those tests will apply.
- CThe practice of testing the smallest chunks of an application as possible in isolation from the rest of the program.
41What is JUnit?
- AAutomates the process of having to import and update dependencies manually.
- BSets up the dev environment [src folder containing main and test] in a new project, and manages build cycle of said project, for the developer.
- CA tool that generates unit tests for the developer
- DBoth automates the process of having to import and update dependencies manually, and sets up the dev environment [src folder containing main and test] in a new project, and manages build cycle of said project, for the developer.
- EA testing framework for developing and running unit tests for your code.
42Select the correct syntax for a test case method with JUnit
- A@Test
public void testSampleMethod() { //code } - Bpublic TestResult testSampleMethod() { //code }
- C@TestCase
public void testSampleMethod() { //code }
- A@Test
43A method signature includes the return type
- AVerdadero
- BFalso
Información
- Descripción
- Full Stack Development Full Stack Development Test sobre Java + OOP Fundamentals, creado por myc elium el 19/12/2025.
- Autor
- myc elium
- Idioma
- English
- Visitas
- 1
- Etiquetas
- Valoración
- Aún sin valoraciones Valora este test