You are on page 1of 30

WEEK 1 – 9 ONLY

Question 1
Complete
Mark 1.00 out of 1.00
A child class inherits all the methods of every other class.

Select one:
a. False
b. True
Question 2
Complete
Mark 0.00 out of 1.00

Flag question
Question text

What can come before an else statement?

Select one:
a. If statement
b. all of the choices
c. If-else-if statement
d. none of the choices
e. else-if statement
Question 3
Complete

Flag question
Question text

The operator “new” allocates a memory block the size of what is


declared.

Select one:
a. True
b. False
Question 4
Complete

Flag question
Question text

Declaring an object in Java uses the new keyword to create a new


object.

Select one:
a. False
b. True
Question 5
Complete
Mark 1.00 out of 1.00

Flag question
Question text

Abstraction works by hiding the implementation details and showing


only the functions necessary.

Select one:
a. True
b. False
Question 6
Complete
Mark 1.00 out of 1.00

Flag question
Question text

Please refer to figure 1 to answer the question below:


The output of println is _______

Select one:
a. 0
b. 55555
c. error
d. 12345
Question 7
Complete

Flag question
Question text

While loops can use Booleans at test expressions.

Select one:
a. True
b. False
Question 8
Complete

Flag question
Question text

When polymorphism is used, the Java object can only take one form.
Subclasses should have the same function with the parent class.

Select one:
a. False
b. True
Question 9
Complete
Mark 0.00 out of 1.00
Flag question
Question text

Please refer to figure 1 to answer the question below: If the test


expression “num <= 10” is changed to “num <= 2”, the final value of
num would be _______.

Select one:
a. Error
b. 2
c. 5
d. 4
Question 10
Complete

Flag question
Question text

While statements check the test expression at the end.

Select one:
a. True
b. False
“||” and “&&” can be used in conditional statements.

Select one:
a. False
b. True
All are methods of the array class except _______.

Select one:
a. substring( )
b. equals( )
c. toString( )
d. length( )
Question 3
Complete
Mark 1.00 out of 1.00

Flag question
Question text

A superclass is also known as a parent class.

Select one:
b. True
Question 4
Complete
Mark 1.00 out of 1.00

Flag question
Question text

Arrays are_______.

Select one:
a. Objects

This type of declaration is discouraged.

Select one:
b. None of the choices
Question 6
Complete
Mark 1.00 out of 1.00

Flag question
Question text
The return value of the length( ) method is an integer

Select one:
a. True
Question 7
Complete
Mark 0.00 out of 1.00

Flag question
Question text

Statements can be expressions.

Select one:
b. True
Question 8
Complete
Mark 1.00 out of 1.00

Flag question
Question text

Another loop can be used as test expression.

Select one:
a. False
Question 9
Complete
Mark 0.00 out of 1.00

Flag question
Question text

The length( ) method returns the size (number of indices) has.

Select one:
a. True
Inherited fields and methods can be used _______ by child classes.

Select one:
c. Directly

Question 1
Complete
Mark 0.00 out of 1.00

Flag question
Question text

Switches can work properly even without the “break” expression.

Select one:
a. False
Please refer to figure 1 to answer the question below:
The output of println is _______

Select one:
c. 55555
The sort( ) method is always ascending.

Select one:
b. True
Switches are always used with if-else statements

Select one:
b. False
Variables must be declared as _______ for it to be fully hidden.

Select one:
b. Private

What does ‘new’ in int[ ] myArray = new int[n] do?

Select one:
d. Assigns memory for the array
Blocks can contain more blocks of code.

Select one:
a. True

The equivalent of Paragraphs in coding is?

Select one:

c. Blocks
String[ ][ ][ ] myArray is a declaration of ________ array.

Select one:
o. 3-d or 3-dimensional
Question 1
Complete
Mark 1.00 out of 1.00

Flag question
Question text

The length( ) method returns the size (number of indices) has.

Select one:
a. True
Question 2
Complete
Mark 1.00 out of 1.00

Flag question
Question text

The return value of the length( ) method is an integer

Select one:
b. True
Question 3
Complete
Mark 1.00 out of 1.00
Flag question
Question text

Abstraction works by hiding the implementation details and showing


only the functions necessary.

Select one:
a. True
Question 4
Complete
Mark 1.00 out of 1.00

Flag question
Question text

number++; is a block

Select one:
a. False
Question 5
Complete
Mark 1.00 out of 1.00

Flag question
Question text

The else statement can be used alone.

Select one:
b. False
Question 6
Complete
Mark 1.00 out of 1.00
Flag question
Question text

The expression int[ ] myArray = new int[10] will ________ memory that
can contain 10 integers.

Select one:
o. Allocate
Question 7
Complete

Flag question
Question text

“||” and “&&” can be used in conditional statements.

Select one:
a. True
Question 8
Complete
Mark 1.00 out of 1.00

Flag question
Question text

A polymorphic object can pass more than one Is-a test.

Select one:
a. True
Question 9
Complete
Mark 1.00 out of 1.00
Flag question
Question text

Among the statements below which is only an expression

Select one:
b. “string1” + “string2”
Question 10
Complete
Mark 1.00 out of 1.00

Flag question
Question text

The operator “new” allocates a memory block the size of what is


declared.

Select one:
a. True
True or False: Netbeans is one of the IDEs or Integrated Development
Environment to run Java programs.

Answer:
Question 2
Complete
Mark 1.00 out of 1.00

Flag question
Question text

True or False: Many programmers can be literate with Java programming


language for it is intended to be that way.

Answer:
Question 3
Complete
Mark 1.00 out of 1.00

Flag question
Question text

Read each statement carefully and decide whether it’s TRUE or FALSE.

The last line of code, with a close brace { symbol, is properly


indented.
The last line of code, with a close brace { symbol, is properly
indented.

Select one:
False
Question 4
Complete
Mark 1.00 out of 1.00

Flag question
Question text

True or False: When you run javac in a command line interface, it will
automatically create another file with a filename extension .class.

Answer:
Question 5
Complete
Mark 1.00 out of 1.00

Flag question
Question text

Read each statement carefully and decide whether it’s TRUE or FALSE.
On line 6, average is equal to 0. But on line 9, average will be equal
to 100.
The last line of code, with a close brace { symbol, is properly
indented.

Select one:
False
Question 6
Complete
Mark 1.00 out of 1.00

Flag question
Question text

Read each statement carefully and decide whether it’s TRUE or FALSE.

If you run this program, the second line of output will read Your
score is:

The last line of code, with a close brace { symbol, is properly


indented.

Select one:
True
Question 7
Complete
Mark 1.00 out of 1.00

Flag question
Question text

True or False: Syntax is basically the spelling and grammar errors


compiled in a Java programming language. It should be avoided in
writing apps and applets.
Answer:
Question 8
Complete
Mark 1.00 out of 1.00

Flag question
Question text

True or False: JDK or Java Design Kit is required to compile and run
Java apps and applets.

Answer:
Question 9
Complete
Mark 1.00 out of 1.00

Flag question
Question text

Read each statement carefully and decide whether it’s TRUE or FALSE.

The following figure shows the Netbeans Integrated Development


Environment.

The last line of code, with a close brace { symbol, is properly


indented.

Select one:
True
Question 10
Complete
Mark 1.00 out of 1.00
Flag question
Question text

Read each statement carefully and decide whether it’s TRUE or FALSE.

There are no errors in the program.


The last line of code, with a close brace { symbol, is properly
indented.

Select one:
False
Question 1
Complete
Mark 1.00 out of 1.00

Flag question
Question text

True or False: A boolean variable can only have two values; it is


either true or false.

Answer:
Question 2
Complete
Mark 1.00 out of 1.00

Flag question
Question text

Refer to the block of codes below. Read each statement carefully and
decide whether it’s TRUE or FALSE.
The first line of the code should have either a yes or no value.

Answer:
Question 3
Complete
Mark 1.00 out of 1.00

Flag question
Question text

True or False: Public, static and void are sample of Java reserved
keywords.

Answer:
Question 4
Complete
Mark 1.00 out of 1.00

Flag question
Question text

Refer to the block of codes below. Read each statement carefully and
decide whether it’s TRUE or FALSE.

There are keywords found in line 7.

Answer:
Question 5
Complete
Mark 1.00 out of 1.00

Flag question
Question text

Refer to the block of codes below. Read each statement carefully and
decide whether it’s TRUE or FALSE.
Line 9 uses a traditional comment which uses double forward slash.

Answer:
Question 6
Complete
Mark 1.00 out of 1.00

Flag question
Question text

Refer to the block of codes below. Read each statement carefully and
decide whether it’s TRUE or FALSE.

There are five (5) separators used in line 8.

Answer:
Question 7
Complete
Mark 1.00 out of 1.00

Flag question
Question text

Refer to the block of codes below. Read each statement carefully and
decide whether it’s TRUE or FALSE.

There are no errors on line 8.

Answer:
Question 8
Complete
Mark 1.00 out of 1.00

Flag question
Question text
Refer to the block of codes below. Read each statement carefully and
decide whether it’s TRUE or FALSE.

There are three (3) separators found in line 13.

Answer:
Question 9
Complete
Mark 1.00 out of 1.00

Flag question
Question text

Refer to the block of codes below. Read each statement carefully and
decide whether it’s TRUE or FALSE.

If there are no errors in the program, line 9 would display I weigh


160.

Answer:
Question 10
Complete
Mark 1.00 out of 1.00

Flag question
Question text

Refer to the block of codes below. Read each statement carefully and
decide whether it’s TRUE or FALSE.

Assuming there are no errors in the code, line 13 would display When I
graduate, I’d be 18.

Answer:
Refer to the program below. Read each statement carefully and write
the output for each line specified.

Line 17 will display on the screen.


Refer to the program below. Read each statement carefully and write
the output for each line specified.

Line 11 will display on the screen.

Question 1
Complete
Mark 2.00 out of 2.00
Flag question
Question text

True or False: The conditional AND operator uses two ampersand (&&)
symbols.

Answer:
Question 2
Complete
Mark 2.00 out of 2.00

Flag question
Question text

True or False: The modulus operator returns the remainder of a


division operation instead of the quotient.

Answer:
Observe the following statements and decide whether the variable
result’s value is TRUE or FALSE.
Given that:
int x = -77;
int z = 43;
result = (z < x && 1 != 10) ? true : false;
result = 90 < x || -1 < z;

Select one:
True

Please refer to Figure 2 to answer the question below:


Figure 2 is an example of?
Select one:
c. If-else-if nested in a switch
Question 2
Complete
Mark 1.00 out of 1.00

Flag question
Question text

x+1 is example of a statement.

Select one:
a. False
Question 3
Complete
Mark 1.00 out of 1.00

Flag question
Question text

Polymorphic objects can pass ________ Is-a test.

Select one:
d. More than one
Question 4
Complete
Mark 1.00 out of 1.00

Flag question
Question text

A superclass is also known as a parent class.

Select one:
a. True
Question 5
Complete
Mark 1.00 out of 1.00

Flag question
Question text

Loops can be stopped with a break; statement.

Select one:
b. True
Question 6
Complete
Mark 1.00 out of 1.00

Flag question
Question text

For-loops can be nested in while loops.

Select one:
a. True
Question 7
Complete
Mark 1.00 out of 1.00

Flag question
Question text

While statements check the test expression at the end.

Select one:
a. False
Question 8
Complete
Mark 1.00 out of 1.00
Flag question
Question text

Blocks can be one liner or huge classes.

Select one:
b. True
Question 9
Complete
Mark 1.00 out of 1.00

Flag question
Question text

Statements can be expressions.

Select one:
a. False
Question 10
Complete
Mark 1.00 out of 1.00

Flag question
Question text

Expressions are like clauses.

Select one:
b. True
This type of declaration is discouraged.

Select one:

d. String myArray[ ];

Question 2
Complete

Mark 1.00 out of 1.00

Flag question

Question text

________ is one of the four fundamental concepts, this is also known as data
hiding.

Select one:

b. Encapsulation

Question 3
Complete

Mark 1.00 out of 1.00

Flag question

Question text

A class block can be an expression

Select one:

a. False

Question 4
Complete

Mark 1.00 out of 1.00

Flag question
Question text

Among the expressions below which is a statement?

Select one:

e. number++;

Question 5
Complete

Mark 1.00 out of 1.00

Flag question

Question text

String[ ][ ] myArray is a declaration of ________ array.

Select one:

f. 2-d or 2-dimensional

Question 6
Complete

Mark 1.00 out of 1.00

Flag question

Question text

Expressions can be long and complex.

Select one:

a. True

Question 7
Complete
Mark 1.00 out of 1.00

Flag question

Question text

Arrays are_______.

Select one:

d. Objects

Question 8
Complete

Mark 1.00 out of 1.00

Flag question

Question text

While loops can use Booleans at test expressions.

Select one:

b. True

For-loops can check the test expression at the end.

Select one:
b. False
Started on Thursday, 6 August 2020, 12:44 PM
State Finished
Completed on Thursday, 6 August 2020, 12:47 PM
Time taken 2 mins 19 secs
Grade 10.00 out of 10.00 (100%)
Question 1
Complete
Mark 1.00 out of 1.00
Flag question
Question text

Please refer to Figure 2 to answer the question below:


If the value of “pStr” in line 7 is changed to _______ then the value
of “pStr” in line 24 will be changed as well.

Select one:
b. True
Question 2
Complete
Mark 1.00 out of 1.00

Flag question
Question text

Using a break; statement causes the loop to jump to the next


iteration.

Select one:
b. False
Question 3
Complete
Mark 1.00 out of 1.00

Flag question
Question text

The test expressions in conditional statements can be left empty.

Select one:
b. False
Question 4
Complete
Mark 1.00 out of 1.00
Flag question
Question text

Please refer to Figure 2 to answer the question below:


Figure 2 is an example of?

Select one:
a. If-else-if nested in a switch
Question 5
Complete
Mark 1.00 out of 1.00

Flag question
Question text

x+1 is example of a statement.

Select one:
a. False
Question 6
Complete
Mark 1.00 out of 1.00

Flag question
Question text

In instantiating an object, the keyword instance is used.

Select one:
a. False
Question 7
Complete
Mark 1.00 out of 1.00
Flag question
Question text

Declaration clauses are declared as “number + 1”.

Select one:
a. False
Question 8
Complete
Mark 1.00 out of 1.00

Flag question
Question text

Expressions can be statements.

Select one:
b. True
Question 9
Complete
Mark 1.00 out of 1.00

Flag question
Question text

Please refer to Figure 2 to answer the question below:


The value of “pStr” in line 24 is _______.

Select one:
c. tralse
Question 10
Complete
Mark 1.00 out of 1.00
Flag question
Question text

The sort( ) method is always ascending.

Select one:
a. True

You might also like