Worksheets4thQuarter Review Comprog 2
Total questions: 20
Worksheet time: 15mins
What is the purpose of Java data types?
To manage memory allocation
To define the structure of a class
To specify the type of data a variable can hold
To create user interfaces
Which of the following is a primitive data type in Java?
String
int
Object
ArrayList
What does the 'final' keyword indicate in Java?
The variable can be changed
The variable is an instance variable
The variable cannot be changed once assigned
The variable is static
Which keyword is used to handle exceptions in Java?
throw
catch
try
All of the above
What is encapsulation in OOP?
Hiding complex details
Bundling data with methods
Acquiring properties of another class
Changing method behavior
Which of the following is NOT a control flow keyword in Java?
if
for
while
class
Which of the following is a non-primitive data type?
char
boolean
String
int
What does the 'static' keyword signify?
Cannot be changed
Belongs to the instance
Is an abstract method
Belongs to the class
What is the role of a debugger in an IDE?
To compile code
To find and fix errors
To manage versions
To write code
Which of the following is a feature of Integrated Development Environments (IDEs)?
Network Configuration
Web Hosting
Database Management
Code Editor
What is the purpose of version control?
To write documentation
To debug applications
To compile code
To track code changes
Which of the following is an example of a high-level programming language?
Assembly Language
Machine Language
Java
Binary Code
What is the main function of a compiler?
Translates entire code before running
Formats the code
Translates code line by line
Debugs the code
Which of the following IDEs is specifically for Python?
Eclipse
NetBeans
PyCharm
Visual Studio Code
What is the purpose of code autocompletion?
To debug the code
To compile the code
To suggest code as you type
To format the code
What is a breakpoint in debugging?
A point where code starts
A point where code is compiled
A point where code execution stops
A point where errors are logged
Which of the following is NOT a Java keyword?
method
public
class
static
What does the 'char' data type store?
An integer
A string of characters
A boolean value
A single character
What is the role of an interface in Java?
To handle exceptions
To provide a blueprint for classes
To define a class
To create objects
Which of the following is a feature of object-oriented programming?
Encapsulation
Compilation
Debugging
Execution
