Font size
WorksheetsOOP Midterms
Total questions: 50
Worksheet time: 31mins
Java is created in 1995 by Oak
TRUE
FALSE
Java is a popular programming language for creating mobile applications, desktop applications, web applications, games, and database connections
TRUE
FALSE
To combine string literals and values, the assignment operator is used.
TRUE
FALSE
The Java Main Class must be enclosed in a method.
TRUE
FALSE
In Java Variable Declaration if there are multiple variables with the same type, you can comma-separate.
TRUE
FALSE
Variables can be of any length.
TRUE
FALSE
Variables should be declared first before you could use them.
TRUE
FALSE
Variables can have numbers and also start with them.
TRUE
FALSE
A problem-solving approach where computations are carried out using objects.
Class
OOP
Objects
Java
Blueprint of the program
Main method
Function
Object
Class
Attribute of an object or an aspect of its behavior
Objects
Properties
Attributes
Methods
How many Data Types are there in Java?
7
10
8
9
A way for you to refer to the data when you need to retrieve or manipulate them.
Access Modifiers
Data type
Variable
Data Manipulation
Used to perform operations in variables and values.
Relational
Arithmetic
Operators
Logical
Data type enclosed in single quotes.
Boolean
Byte
Character
Short
System.out.print("Papasa ako sa" + "MIDTERMS!"); the '+' symbol is used as?
Relational Operator
Concatenation Operator
Logical Operator
Arithmetic Operator
What operator returns the truth value (Boolean; True or False)?
Boolean Operator
Relational Operator
Logical Operator
Conditional Operator
What operator is used to combine multiple conditions depending on your desired results?
Relational Operators
Conditional Operators
Arithmetic Operators
Logical Operators
How many decimal places does a float can contain?
4 to 5
6 to 7
7 to 8
5 to 6
What do you call the nonprintable characters in Java?
New Line
Escape Sequences
Nonprintable Characters
\n
To add a package, (a) is the magic word.
Escape sequences are preceded by:
(a)
What library do we use when the program needs to accept an input from the user?
input
scanner class
Import
java.util
What Scanner method do we use in reading a string value from the user?
nextChar()
nextLine()
nextInput()
nextString()
How many decimal places does a double can have?
14
17
13
15
In Java, variable names should be composed of: (check all answers that applies)
underscore
dollar sign
ampersand
alphanumeric characters
What are the symbols used in arithmetic operators?
+, -, *, /, %
+, -, *, /, %, ++, --
+, -, *, /, %, =, ++, --, ==
+, -, *, /, %, =
In the following, which is NOT a Conditional Statements?
if-else
else-if
if statement
match-case
What are the symbols used in logical operators?
|, &, !
!, &&, ||
not, and, or
~, ^, v
for(____; ____; ____){
// Statement block } (separate your answer with a space)
(a)
immediately terminates the loop.
break;
return 0;
exit;
stop;
Moves to the end of the loop
end;
skip;
continue;
break;
Collection of elements of the same type.
Variables
Arrays
List
Ouch
What is the Java Convention in declaration of new array?
int[] array[];
int array[];
int array;
int[] array;
What allocation method is allocated during runtime?
active allocation
dynamic allocation
runtime allocation
static allocation
How do we access and assign elements in an Array?
initialization
declaration
indexing
looping
What do you call a loop if another loop exists in the body of a loop?
Progressive Looping
Nested Loops
Double Loop
Multiple Loop
What kind of loop execute the statement in the loop first, before checking the condition?
for-each
do-while
for
while
In a for-loop declaration what part checks if the loop still needs to be executed; or stopped?
break
condition
statement
if-else
It performs the updates on variables used in the loop.
decrement
var++
iterator
increment
Copies elements from one array to another.
Ctrl + C
ArrayCopy
Clone
Copy
int num = 99;
System.out.println("num");
(a)
System.out.print("Papasa ");
System.out.print("ako!");
(a)
System.out.print("How are you \"World\"?");
(a)
boolean testExpr = ((5 + 3 == 3 + 5))
(a)
char letter = 'b', digit = '7';
boolean testExpr = !((letter == 'A' || letter == 'a') && (digit == '4' || digit <= '8'));
(a)
char letter = 'a', digit = '0';
boolean testExpr = (letter <= 97 && digit >= 48);
(a)
!FALSE
(a)
int num1 = 72, num2 = 4, rem = num1 % num2;
boolean testExpr = (rem == 12 % 7);
(a)
Papasa ba ako this midterms?
Yes
Opo
True
!False
