Professional Documents
Culture Documents
Complete
Mark 1.00 out of 1.00
Question text
Observe the following statements and decide whether the
variable result’s value is TRUE or FALSE.
Given that:
int x = -77; The last line of code, with a close brace { symbol, is properly
indented.
int z = 43;
indented.
result = (z != 43) ? true : false;
Select one:
Select one:
True
True
False
False
Question 3
Question 2 Complete
Complete Mark 1.00 out of 1.00
Mark 1.00 out of 1.00
Question text
Question text
True or False: Brackets [] are also separators used in declaring
Read each statement carefully and decide whether it’s TRUE arrays.
or FALSE.
Answer:
True
Question 4
Complete
Mark 1.00 out of 1.00
Question text
Refer to the block of codes below. Read each statement
carefully and decide whether it’s TRUE or FALSE.
There is an error in line 9.
Answer:
TRUE
There are no errors in the program.
Question 5 Select one:
Complete
Mark 1.00 out of 1.00
False
Question text
Read each statement carefully and decide whether it’s TRUE
or FALSE.
Question 9
Complete
Mark 1.00 out of 1.00
Question text
True or False: You’ll know there’s an error if you see a red
circle with an exclamation point in Netbeans IDE.
Answer:
True
Question 10
Complete
Mark 1.00 out of 1.00
Question text
Observe the following statements and decide whether the
variable result’s value is TRUE or FALSE.
Given that:
int x = -77;
int z = 43;
Question 1 If there are no errors and this simple program runs through CLI,
Complete the first line will display: Hi, students!
Mark 1.00 out of 1.00
Select one:
Question text
False
Observe the following statements and decide whether the
variable result’s value is TRUE or FALSE. Question 3
Complete
Given that: Mark 1.00 out of 1.00
Select one:
If there are no errors in the program, the first line of output would
True read Hi, I’m a normal person.
False Answer:
FALSE
Question 2
Complete
Mark 0.00 out of 1.00 Question 4
Complete
Question text 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.
When the program runs, and assuming there are no errors, its
first line will be begin printing.
Answer: Complete
Mark 1.00 out of 1.00
FALSE
Question text
Question 6
Complete
True or False: When you run javac in a command line interface, it
Mark 1.00 out of 1.00 will automatically create another file with a filename extension
.class.
Question text
Answer:
True or False: The conditional AND operator uses two True
ampersand (&&) symbols.
Answer:
True
Question 8
Complete
Mark 1.00 out of 1.00
Question text
True or False: A boolean variable can only have two values; it is
either true or false.
Answer:
True
Question 9
Complete
Mark 0.00 out of 1.00
Question text
Refer to the block of codes below. Read each statement carefully
and decide whether it’s TRUE or FALSE.
Question 10
Question 1 On line 6, average is equal to 0. But on line 9, average will be
Complete equal to 100.
Mark 1.00 out of 1.00
Select one:
Question text
True
Refer to the block of codes below. Read each statement carefully False
and decide whether it’s TRUE or FALSE.
Question 4
Complete
If there are no errors in the program, line 9 would display I weigh Mark 1.00 out of 1.00
160.
Question text
Answer:
FALSE Refer to the program below. Read each statement carefully and
write the output for each line specified.
Question 2
Complete 18
Mark 1.00 out of 1.00 Line 13 will display Answer on the screen.
Question text Question 5
Complete
True or False: The subtraction assignment operator subtracts the Mark 1.00 out of 1.00
left and right operand and assigns the difference to the operand
at the right.
Question text
Answer:
False Observe the following statements and decide whether the
variable result’s value is TRUE or FALSE.
Question 3 Given that:
Complete
Mark 1.00 out of 1.00 int x = -77;
Question 10
Complete
Mark 1.00 out of 1.00
Flag question
Question text
Question text
True or False: Traditional comments start with /** (forward slash
True or False: Single equal sign (=) is used for assigning values and two asterisks) and ends with */ (asterisk and forward slash).
while double equal sign (==) is used in comparing values.
Answer:
Answer: False
True
Question 8
Complete
Mark 0.00 out of 1.00
Question text
Select one:
True
False
Question 3
Complete
Mark 1.00 out of 1.00
Question text
There are five (5) separators used in line 8.
Refer to the block of codes below. Read each statement carefully
and decide whether it’s TRUE or FALSE. Answer:
True
Question 6
Complete
Mark 1.00 out of 1.00
Question text
True or False: The subtraction assignment operator subtracts the
left and right operand and assigns the difference to the operand
at the right.
Answer:
False Select one:
True
Question 7
Complete False
Mark 1.00 out of 1.00
Question 9
Question text Complete
Mark 1.00 out of 1.00
True or False: Single equal sign (=) is used for assigning values
while double equal sign (==) is used in comparing values. Question text
Answer: Observe the following statements and decide whether the
True variable result’s value is TRUE or FALSE.
Given that:
Question 8
Complete int x = -77;
Mark 1.00 out of 1.00
int z = 43;
Question text
result = (z < x && 1 != 10) ? true : false;
Read each statement carefully and decide whether it’s
result = (x = 100) >= z;
TRUE or FALSE.
There are no errors in the program. Select one:
True
False
Question 10
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:
True
Mark 1.00 out of 1.00
Question 1
Complete Question text
Mark 1.00 out of 1.00
Question text Observe the following statements and decide whether the
variable result’s value is TRUE or FALSE.
Refer to the block of codes below. Read each statement carefully
Given that:
and decide whether it’s TRUE or FALSE.
int x = -77;
There are keywords found in line 7. int z = 43;
Answer: result = (x * z + (z += 7)) >= 100;
true
Select one:
True
Question 2
Complete False
Mark 1.00 out of 1.00
Question 5
Question text
Complete
Refer to the block of codes below. Read each statement carefully Mark 1.00 out of 1.00
and decide whether it’s TRUE or FALSE. Question text
True or False: There are five types of integer data types – byte,
There is an error in line 9. short, int, long and float.
Answer: Answer:
true
false
Question 3
Question 7
Complete
Complete
Mark 0.00 out of 1.00
Mark 1.00 out of 1.00
Question text Question text
True or False: Java’s ternary operator is a short hand for the if- True or False: A boolean variable can only have two values; it is
then-else statement which uses a question mark and a colon. either true or false.
Answer: True Answer:
true
Question 4
Complete
Question 8 int z = 43;
Question 9 result = 90 < x || -1 < z;
Complete
Mark 1.00 out of 1.00 Select one:
Question text True
False
True or False: You’ll know there’s an error if you see a red circle
with an exclamation point in Netbeans IDE.
Answer: True or False: The modulus operator returns the remainder of a
division operation instead of the quotient.
true
Answer:
Question 10 true
Complete
Mark 1.00 out of 1.00 True or False: Identifiers in Java are, in simple words, name that
you give to Java class, variables and methods.
Question text
Answer:
Refer to the block of codes below. Read each statement carefully
true
and decide whether it’s TRUE or
Question 2
Complete
Mark 1.00 out of 1.00 If you run this program, the second line of output will read Your
Question text score is:
Question text
Refer to the block of codes below. Read each statement carefully Question 10
and decide whether it’s TRUE or FALSE. Complete
Mark 1.00 out of 1.00
Answer: Refer to the block of codes below. Read each statement carefully
and decide whether it’s TRUE or FALSE.
TRUE
The last line of code will output 100.0.
Answer:
TRUE
Question 1 Assuming there are no errors in the code, line 13 would display
Complete When I graduate, I’d be 18.
Mark 1.00 out of 1.00
Answer:
Question text TRUE
Question text
Question 5
Refer to the block of codes below. Read each statement carefully Complete
and decide whether it’s TRUE or FALSE. Mark 1.00 out of 1.00
Question text
There are no errors on line 8.
True or False: Semicolon (;) is a separator used to end a Java
Answer: statement.
FALSE
Answer:
True
Question 3
Complete
Mark 1.00 out of 1.00 Question 6
Complete
Question text Mark 1.00 out of 1.00
Refer to the block of codes below. Read each statement carefully Question text
and decide whether it’s TRUE or FALSE.
True or False: When you run javac in a command line interface, it Answer:
will automatically create another file with a filename extension True
.class.
Answer: Question 9
Complete
True Mark 1.00 out of 1.00
Question 7
Question text
Complete
Observe the following statements and decide whether the
Mark 1.00 out of 1.00
variable result’s value is TRUE or FALSE.
Question text
Given that:
Read each statement carefully and decide whether it’s int x = -77;
TRUE or FALSE.
int z = 43;
result = !((x * 10) < z);
Select one:
True
False
figure shows the Netbeans Integrated Development Environment.
Question 10
Select one: Complete
True Mark 1.00 out of 1.00
Question 8
True or False: Logical OR operator will result to false if one of the
Complete expressions is false.
Mark 1.00 out of 1.00
Answer:
Question text False
True or False: Public, private and protected are some of the Question text
return types used in Java programming. Determine the output.
Answer:
False
Select one:
Question 3 a. 123
Complete
Mark 1.00 out of 1.00
b. 169
c. error
Question text
d. 155
Question 9
TRUE OR FALSE: This is an example of concatenation. Complete
Mark 1.00 out of 1.00
Select one:
True Question text
Question text
Question 15
Determine the output. Complete
Mark 1.00 out of 1.00
Question text
Select one:
True or False: You’ll know that a variable is a class variable when
a. error you see that variable inside a class with the word static.
b. 4298
Answer:
c. 5698 True
d. 6492
Question 17 True
Complete
Mark 1.00 out of 1.00 False
Question text Question 20
Complete
Strings can be declared with str. Mark 1.00 out of 1.00
Question 18
Complete
Mark 1.00 out of 1.00
a. 4 Question text
b. 36 True or False: Procedural programming involves instructing the
c. error system as to how to complete a task.
d. 351 Answer:
True
Question 19
Complete
Mark 1.00 out of 1.00 Question 2
Complete
Question text Mark 1.00 out of 1.00
Question text
TRUE OR FALSE: The output of this code is “The quick True or False: Variable 1st_num is a good variable name in Java
brown fox” programming.
Select one:
Answer: Question 11
False Complete
Mark 1.00 out of 1.00
Question 5
Complete Question text
Mark 1.00 out of 1.00
Languages which use procedural programming include
Question text C++
C, Answer , FORTRAN, Pascal and BASIC.
True or False: Local variables are declared inside the default
method. Question 12
Complete
Answer: Mark 0.00 out of 1.00
False
Question text
Question 9 Determine the output.
Complete
Mark 1.00 out of 1.00
Question 10 Question 13
Complete Complete
Mark 1.00 out of 1.00 Mark 1.00 out of 1.00
True or False: Variable names in Java are not necessarily case In procedural programming, a step-by-step sequence of
Task
sensitive. instructions is followed to perform a Answer .
Answer: Question 14
False Complete
Mark 1.00 out of 1.00
Question text Question text
True or False: Instance variables are declared inside a method
but outside a class.
TRUE OR FALSE: This is an example of concatenation.
Answer:
Select one:
False
True
Question 15 False
Complete
Mark 1.00 out of 1.00 Question 18
Complete
Question text Mark 1.00 out of 1.00
Question text
TRUE OR FALSE: The output of this code is “The quick
brown fox”
TRUE OR FALSE: “val_2” contains “The”.
Select one:
Select one:
True
False
True
Question 16 False
Complete
Mark 1.00 out of 1.00 Question 19
Complete
Question text Mark 1.00 out of 1.00
True or False: Divide and conquer strategy, in programming, is Question text
also known as the top-down design.
True or False: You’ll know that a variable is a class variable
Answer: when you see that variable inside a class with the word static.
True
Answer:
True
Question 17
Complete
Mark 1.00 out of 1.00 Question 20
Complete
Mark 1.00 out of 1.00
Question text
Fill in the blank: In designing the program specification,
Output
determine first the input, then the Answer and then
analyze the problem.
Question 1
Answer saved
Flag question
Question text
Method invocations are statements
Flag question
Select one:
Question text
Refer to the block of codes below. Read each statement carefully a. False
and decide whether it’s TRUE or FALSE.
b. True
Question 3
Answer saved
b. Final
Marked out of 1.00
c. Abstract class
d. Directly
e. Parent class
Question text
g. Private
True or False: In this expression – counter++ - a value of 1 is
h. More than one added to counter twice.
Answer:
i. Different forms True
j. Super class
Question 6
Answer saved
Question 4
Answer saved Marked out of 1.00
Flag question
Answer:
False
Question 5
Answer saved
Answer:
a. False
barfoo
b. True
Question 7
Answer saved Question 9
Answer saved
Marked out of 1.00
Marked out of 1.00
Flag question
Flag question
Question text
Question text
True or False: Keywords are Java reserved words which are used
as identifier for interface, constants and constructs.
Answer:
True TRUE OR FALSE: The assigned values of “val_1” & “val_2”
are integers.
Question 8 Select one:
Answer saved
False
Question 10
Answer saved
Question text
An array can be infinitely long.
Select one:
Question text
1+2+3/4*5 is an unambiguous expression
Select one:
Flag question
a. False
Question text
b. True
simplify
In programming, abstracting a problem means Answer it.
Question 13
Answer saved
Question 11
Answer saved Marked out of 1.00
Marked out of 1.00
Flag question
Flag question Question text
Question text Refer to the block of codes below. Read each statement carefully
Fill in the blank: Procedural programming is done and decide whether it’s TRUE or FALSE.
applica
because Answer cannot decide on their own what
sequence of tasks should be followed.
Question 12
Answer saved
Flag question
Answer: Answer:
TRUE False
Question 14 Question 16
Answer saved Answer saved
Answer:
False
Question 15
Answer saved Answer:
Marked out of 1.00 foo
Question 17
Answer saved
Flag question
Question text
True or False: Non-procedural programming focuses on how a
task is done rather than on what task should be done. Flag question
Question text
True or False: There are standard naming convention for Java
classes, methods, variables and constants.
Answer:
Flag question
True
Question text
Question 18
Answer saved
The term of each pass through a loop makes is called?
a. cycle
b. turn around
Flag question
c. loop
b. True
Question 19
Answer saved
Flag question
Marked out of 1.00
Question text
Determine the output.
Question 22
Answer saved
Select one:
Remove flag
b. hodog Refer to the code snippet below. Identify what part of a method is
shown in each number (the underlined one).
c. dogehot
d. hotdog
Question 21
Answer saved
Flag question
Question 23
Question text Answer saved
Answer:
False
Answer saved
Flag question
Question text
An int can be used even if it is declared outside a for-loop. Flag question
Flag question
Question text
Flag question
Question text
An iteration of a loop is equivalent to one pass through. Select one:
Select one:
a. error
a. True
b. fudgee bar
b. False
c. chocolate bar
Question 28
Answer saved d. foo chocolate
Marked out of 1.00
Question 29
Answer saved
Flag question
Question text
Flag question
Determine the output.
Question text
The Arrays.sort( ) method sorts an array into _________ order.
Select one:
a. descending
b. None of the choices
b. False
Question 32
Answer saved
Flag question
Marked out of 1.00
Question text
Loops must always have a continue or break statement.
Select one:
Question 33
Answer saved
Flag question
Question text
Infine for-loops can be declared as for( ){ }.
Select one: The filename of the Java file above is computesum.java.
True
False The last line of code, with a close brace { symbol, is properly
Question 34 indented.
Answer saved
True
False
Question 35
Flag question Answer saved
Flag question
Refer to the block of codes below. Read each statement carefully Question text
and decide whether it’s TRUE or FALSE.
Determine the output.
Select one:
a. f o
b. o f
c. o o
d. error
Question 36
Answer saved
Question 38
Answer saved
Flag question
Question text
Question text
A loop can contain no expressions or statements inside.
Select one:
a. False
b. True
Question 39
Answer saved
False a. Index
b. object
c. bytes
l. arraycopy( )
m. any
Flag question
n. Fills
Question text
o. one The equivalent of clauses in coding is?
b. Expressions
c. Statements
Answer:
d. Paragraphs
local variable
Question 42
Answer saved Question 43
Answer saved
Marked out of 1.00
Marked out of 1.00
Flag question
Flag question
Question text
Question text
Refer to the code snippet below. Determine whether the given is
a local variable, instance variable, access modifier or a class Encapsulated data are hidden from other classes.
name.
Select one:
a. True
b. False
Question 44
Answer saved
Flag question
Question text
Flag question
c. both
a. True
Flag question
b. False
Question text
Question 48
Answer saved Refer to the code snippet below. Identify what part of a method is
shown in each number (the underlined one).
Marked out of 1.00
Flag question
Question text
Please refer to figure 1 to answer the question below: GIVEN: public int getArea
If the increment num=num+2 is changed to num++, the final value Answer:
of num will be ________. modifier
Select one:
Question 50
Answer saved
a. 5
Marked out of 1.00
b. 10
c. 0
d. 12
Flag question
Question 49
Answer saved Question text
You cannot use inherited methods directly in a child class. What the break statement in this example does is
Select one:
________.
-Ends the whole instance of the loop
a. True The random( ) method sorts the array randomly.
-False
b. False The last part in a for loop setup can be an ________.
- both
The “1” in arrayName[1] is called an ________.
FOURTH QUARTER EXAM JAVA -Index
PROGRAMMING (PROG-111A) The continue; statement ends all the iterations of a loop.
- False
43/50 Which is not a proper increment?
- n+-;
BY: JOSHUA UNGAB Infine for-loops can be declared as for( ){ }.
- False
If-if is more logical than else-if.
(NOTE: WAG NYO SANA GAMITIN PANG - False
BEBENTA SA IBA JUSKO. SHARE NYO The else statement can be removed if not needed.
SA IBA GUYS) -True
Expressions, Statements and Blocks are like composing
sentences and paragraphs.
-True
The equivalent of clauses in coding is? You can declare a new method in the subclass which is
-Expressions not declared in the superclass.
Int num = 1; for(num=num;num<=10;num++) is an -True
acceptable code snippet. The return value of the equals( ) method is ________ .
-true -None of the choices
Loop that has a pre-determined number of iterations The Arrays.sort( ) method sorts an array into _________
-while order.
An int can be used even if it is declared outside a for- -Ascending
loop. This type of declaration is discouraged: “int myArray[ ]”
-true - True
Overload methods must be the same name as the class An if-else-if-else statement is a block.
-true
-True -0
If the increment num=num+2 is changed to num++, the Ifs and else-ifs test expressions return true or false.
final value of num will be ________. - True
-5 _______ classes increase the encapsulation of you
The term of each pass through a loop makes is called? methods and data.
-iteration - nesting
Loops must always have a continue or break statement. Constructed methods are initialized with 0 or null
-False depending on the data type.
1+2+3/4*5 is an unambiguous expression - true
-False The else statement catches whatever argument the if and
Conditional statements can contain more conditional else-if didn’t
statements. - True
- True An iteration of a loop is equivalent to one pass through.
int num = 1; - true
if(num==1 && num<=1){ 38. If we change the initial value of num in line 6 to “num
body; = 0”, the println output will be _______
} -0
The else-if statement can be used alone.
The conditional statement will _______. - false
- execute the body Abstract methods need sub-classes to contain their
byte( ][ ][ ) myArray; is an example of ________. implementations.
- An error -true
An array _______ hold objects. The method arraycopy( ) does what?
- can - Copies the contents of an array to a destination
A reference variable can be reassigned to other objects array.
provided that it is not declared ________. An array can be infinitely long.
- final - False
The test expression of conditional statement cannot A loop can contain no expressions or statements inside.
contain _______ - true
-! Conditional statements are the same as declaration
Each pass through of a loop is called a cycle. statements.
- True - False
If the increment “num = num + 2” is changed to “num = You cannot use inherited methods directly in a child
num + 1” the final output will be _______.
class.
- False
The equals( ) method compares 2 arrays.
- True
Method invocations are statements
- True
To implement encapsulation, you have to declare class
variables with the private modifier.
- True
Inner class methods can be called by constructing the Answer: val_1 + val_2
inner class.
- False
Encapsulated data are hidden from other classes.
Read each statement carefully and decide whether it’s
- True
TRUE or FALSE.
Answer: foo
Procedural programming will be tricky for
applications.
Answer: small
Answer: barfoo
Refer to the code snippet below. Determine whether the
given is a local variable, instance variable, access
modifier or a class name.
Answer: 200
True or False: A method could be declared without any
parameters.
Answer: False
Answer: error
True or False: Non-procedural programming focuses on Determine the output.
how a task is done rather than on what task should be
done.
Answer: False
Refer to the code snippet below. Determine whether the
given is a local variable, instance variable, access
modifier or a class name.
-TRUE -False
If there are no errors and this simple program runs through CLI, True or False: Variable names in Java are not necessarily case
the first line will display: Hi, students! sensitive.
-False -False
True or False: Brackets [] are also separators used in declaring Determine the output
arrays.
-36
-True
True or False: Public, private and protected are some of the
Substrings can contain 1 or 2 arguments. return types used in Java programming.
-true -False
-True -C++
True or False: The conditional AND operator uses two True or False: Local variables are declared inside the default
ampersand (&&) symbols. method.
-True -False
The string method “length( )” returns the number of TRUE OR FALSE: The output of this code is “The quick
characters within a string. brown fox”
-True -False
A string can contain numbers. Among the expressions below which is a statement?
-True -True
Expressions can be long and complex. -Integers
-true The operator “new” allocates a memory block the size of what is
declared.
number++; is an expression
-true
-true
A class block can be an expression
For-loops has a set number of iterations before starting.
-False
-True
Statements can be expressions.
The equals( ) method can compare more than 2 arrays.
-False
-False
Integer arrays can be populated with characters.
While loops can use Booleans at test expressions.
-False
-True
Declaration clauses are declared as “number + 1”.
The test expression of the if statement is _______
-False
-less than or equal to
Loops can be stopped with a break; statement.
There are four (4) major features of an object-oriented
programming language – encapsulation, inheritance, -True
polymorphism and abstraction.
The equivalent of Paragraphs in coding is?
-True
-Expressions
Using a break; statement causes the loop to jump to the next
iteration. If statements cannot be nested in switches
-False -true
x+1 is example of a statement. The length( ) method returns the size (number of indices) has.
-False -True
number++; is a block When polymorphism is used, the Java object can only take one
form. Subclasses should have the same function with the parent
-False class.
Arrays are -False
Arrays can contain (Answer) number of elements. Switches are always used with if-else statements
-Any -False
“||” and “&&” can be used in conditional statements. True or False: The modulus operator returns the remainder of a
division operation instead of the quotient.
-True
-true
A class statement has three (3) major parts – declaration,
initialization and instantiation. Determine the output.
-False String val_1 = “564298”;
-5 -true
-True -true
Blocks can contain more blocks of code. For-loops can be nested in while loops.
-True -true
If-else statements can be nested in? In instantiating an object, the keyword instance is used.
Statements are equivalent to paragraphs. Object oriented programming utilizes the top down method
-False -False
A (answer) array is an array containing true or false values. Expressions are like clauses.
-boolean -true
The sort( ) method is always ascending. -bar
-true Determine the output.
Arrays are data types. String val_1 = “foo”
-False -foo
The else statement can be used alone. Switches can work properly even without the “break” expression.
-False -True
The fill( ) method (Answer) the array with specific values. Blocks can be one liner or huge classes.
-Fills -True
The output of println is The test expressions in conditional statements can be left empty.
-55555 -False
The person’s weight is declared correctly with the correct data Abstraction works by hiding the implementation details and
type (byte) and value (160). showing only the functions necessary.
-FALSE -True
Determine the output. A single array can hold multiple data types
String val_1 = “foo” -False
String val_2 = “bar” A polymorphic object can pass more than one Is-a test.
val_2 = val_1; -True
System.out.println(val_1); -False
True or False: Public, static and void are sample of Java reserved Abstraction shows the every bit of detail and implementation on
keywords. how an application does something.
-True -False
The value of “pStr” in line 24 is Initialization is a process where the constructor is called for.
-True -True
The default syntax of a constructor is <class_name>(parameter, The default syntax of a constructor is <class_name>( ){ }
parameter){ }
-True
-False
Classes cannot be nested.
A nested class is not an inner class.
-False
-False
Abstract classes cannot have nested classes.
Nested classes causes them to become abstracted
-False
-False
The parent class of a nested class is called an outer class
A nested class is also called
-True
-inner class
An inner class can be constructed directly without reference to
If you want some variables and methods hidden from other the outer class.
classes, you could implement encapsulation where these
-False
variables and methods are wrapped in a single unit.
-True Arrays can be read backwards
-True
A constructor can only have 1-2 overloads or parameters.
-False A single array can hold
All possible data types of an array can be retuned as a string by -One data type
the toString( ) method. Abstracted methods already have implementations inside.
-True -False
Abstracted classes can contain 1 or more abstract methods. are special methods to initialize objects.
-True
-constructors Parallelsorting utilizes
Constructors have 3 basic rules to follow. -More cpu processing cores
-False method can copy one array to another.
Nesting classes increases encapsulation. -arraycopy()
-True LONG QUIZ PROG 112
LONG QUIZ 3
Each index can only contain (Answer) element. 1.Fill in the blanks with the correct answer.
-one Choose the appropriate word from the given
choices.
The sort( ) method can be set to sort only a part of an array. A.A large amount of nested loops are
___________, due to the time and effort it takes
-False to execute.
ANSWER: discouraged
Subclasses or child classes could have different behaviors but B. After a for loop checks the test expression,
still share the same functions from their parent class. it executes the ___________
-True ANSWER: BODY
C.for(int x=0;x<9;x++), What is the last value
Abstract methods must have an explicit return value of ‘x’ at the end of the loop given there are no
break or continue statement inside? _________
-False ANSWER: 9
D. ___________ statement can stop a loop from
An abstract class must not contain abstract methods. performing anymore iterations.
-False ANSWER: BREAK
E.___________ are best kind of loop to use when
Abstracted classes can be nested. the number of iterations is pre-calculated.
ANSWER: for/for loops
-True F. The difference between while and do-while
loops is do-while loops test expression is at
A subclass constructor cannot invoke a superclass constructor.
the ___________
-False ANSWER: END
G.___________ is the term for ever cycle the
A class acquiring fields and methods of another class is called loop makes.
inheritance. ANSWER: ITERATION
H.for(___________) is an infinite for-loop
-True ANSWER: ;;
I. Loops can be nested inside other ___________
ANSWER: LOOP is changed to _______ then the value of “pStr”
J. ___________ loop checks the test expression in line 24 will be changed as well
at the end. ANSWER: TRUE
ANSWER: DO-WHILE 11. Please refer to Figure 2 to answer the
K. The ___________ makes a loop end a cycle question below: The value of “pStr” in line 24
prematurely and start the next iteration is _______
ANSWER: CONTINUE ANSWER: TRALSE
L.___________ are what’s inside the parentheses 12. Statements are equivalent to paragraphs
( ) after the ’for’ ANSWER: FALSE
ANSWER: Test expression 13. The else statement can be used alone
M. The short form of “num = num + 1; is ANSWER: FALSE
ANSWER: num++ 14.The equivalent of Paragraphs in coding is?
N.___________ loops are loops within loops. ANSWER: BLOCKS
ANSWER: NESTED 15. The test expressions in conditional
In a set of nested loops, the___________ most is statements can be left empty.
executed the most times ANSWER: FALSE
ANSWER: INNER 16. What can come before an else statement?
2.A class block can be an expression ANSWER: ALL OF THE CHOICES.
ANSWER: FALSE LONG QUIZ NO. 4
3. Among the expressions below which is a 1.A class acquiring fields and methods of
statement? another class is called inheritance.
ANSWER: number++; ANSWER: TRUE
4. Blocks can contain more blocks of code. 2. A class which contains the abstract keyword
ANSWER: TRUE in its declaration is known as an __________
5. Declaration clauses are declared as “number + ANSWER: Abstract class
1”. 3. A constructor ________ contain an explicit
ANSWER: FALSE return type
6. If-else statements can be nested in? ANSWER: CANNOT
ANSWER” ALL OF THE CHOICIES 4.A nested class is not an inner class
7. number++; is a block ANSWER: FALSE
ANSWER: FALSE 5. A single array can hold ________
8. Please refer to figure 1 to answer the ANSWER: ONE DATA TYPE
question below: The output of println is _______ 6.A subclass constructor cannot invoke a
ANSWER: 55555 superclass constructor
9. Please refer to Figure 2 to answer the ANSWER: FALSE
question below: Figure 2 is an example of? 7. Abstract classes cannot have nested classes
ANSWER: If-else-if nested in a switch ANSWER: FALSE
10. Please refer to Figure 2 to answer the 8.Abstracted classes can be nested
question below: If the value of “pStr” in line 7 ANSWER: TRUE
9. Abstracted classes can contain 1 or more 22. The abstract keyword can be used for _______
abstract methods. and _______
ANSWER: TRUE ANSWER: methods; classes
10.Abstraction shows the every bit of detail and 23.The limit of dimensions an array can have
implementation on how an application does without errors is ________
something ANSWER 255.
ANSWER: FALSE 24. The parent class of a nested class is called
11. All possible data types of an array can be an outer class:
retuned as a string by the toString( ) method ANSWER: TRUE
ANSWER: TRUE. 25. The sort( ) method can be set to sort only a
12.An abstract class must not contain abstract part of an array.:
methods ANSWER: FALSE
ANSWER:FALSE 26. The _______ method can copy one array to
13.An array of integers should be declared as another.
________ ANSWER: arraycopy( )
ANSWER:int[ ] 27. You can also declare new fields in the child
14. Arrays can be read backwards: class which are not in the ________
ANSWER: TRUE ANSWER: PARENT CLASS
15.Byte[ ] myArray is an array of _______ 28. _______ are special methods to initialize
ANSWER: BYTES objects.
16.Each index can only contain ________ element ANSWER: CONSTRUCTORS
ANSWER: ONE 29. ________ is the process of acquiring fields
17.If you want some variables and methods hidden and methods of a parent class or super class.
from other classes, you could implement ANSWER: INHERITANCE
encapsulation where these variables and methods SHORT QUIZ PROG 112
are wrapped in a single unit.
ANSWER: TRUE SHORT QUIZ 6
18. Initialization is a process where the
constructor is called for. 1. If statements cannot be nested in switches
ANSWER: TRUE
19. Parallelsorting utilizes ________. Select one:
ANSWER: More cpu processing cores a. True
20. Polymorphism is the ability of a Java object
to take _______ b. False
ANSWER: Different forms 2. “||” and “&&” can be used in conditional statements.
21. Subclasses or child classes could have
different behaviors but still share the same Select one:
functions from their parent class a. False
ANSWER: TRUE
Select one:
b. True
3. Expressions are like clauses. a. pStr
b. False d. “tralse”;
4. x+1 is example of a statement. e. no error
Select one:
a. True 7. Switches are always used with if-else statements
b. False Select one:
5. Switches can work properly even without the “break” a. True
expression.
b. False
Select one:
a. True 8. number++; is an expression
b. False
Select one:
a. True
6. Please refer to Figure 2 to answer the question below:
b. False
The error in Figure 2 is _______.
9. The type of loop that checks the test expression at the end.
ANSWER: Do-While
10. Which of these is a proper decrement?
ANSWER: X or x—
SHORT QUIZ 7
3. If the test expression “num <= 10” is changed to “num <= 2”, 2. It is ________ to declare an array like this: int array[];.
the final value of num would be _______.
ANSWER: discouraged
ANSWER: 4
3. The sort( ) method is always ascending.
4. The final value of num in the output is ________
ANSWER: TRUE
ANSWER: 12
5. The final output of the code snippet is _______.
4. Arrays are_______.
ANSWER 12
ANSWER: OBJECTS
6. While statements check the test expression at the end.
5. An array is always an _______.
ANSWER: FALSE
ANSWER: OBJECT
7. Using a break; statement causes the loop to jump to the next
6. A _______ array is an array containing true or false values.
iteration.
ANSWER: BOOLEAN
7. Integer arrays can be populated with characters. 6. When polymorphism is used, the Java object can only take one
form. Subclasses should have the same function with the parent
ANSWER:FALSE class.
8. The fill( ) method _______ the array with specific values. ANSWER: FALSE
ANSWER: FILLS 7. Declaring an object in Java uses the new keyword to create a
9. String[ ][ ][ ] myArray is a declaration of ________ array. new object.
10. A single array can hold multiple data types 8. Variables must be declared as _______ for it to be fully hidden.
1. Abstraction works by hiding the implementation details and 10. Inherited fields and methods can be used _______ by child
showing only the functions necessary. classes.
ANSWER: interchangeably
6. Classes cannot be nested.
ANSWER: FALSE
7. Constructors have 3 basic rules to follow.
ANSWER: FALSE
8. A constructor can only have 1-2 overloads or parameters.
ANSWER: FALSE
ANSWER: SUB-CLASSES
FOURTH QUARTER EXAM
1. The method arraycopy( ) does what? 5. If the increment num=num+2 is changed to num++, the final value of num will be
________.
Select one:
Select one:
a. Copies the contents of an array and makes a new one.
a. 0
b. Create multiple array duplicates.
b. 10
c. Copies the contents of an array and deletes the old one.
c. 5
d. Copies the contents of an array to a destination array.
d. 12
3. The else-if statement can be used alone. 7. The else statement catches whatever argument the if and else-if didn’t
Select one: Select one:
a. True a. False
b. False b. True
4. An iteration of a loop is equivalent to one pass through. 8. byte( ][ ][ ) myArray; is an example of ________.
Select one: Select one:
a. False a. An error
b. True b. A 3-dimensional array
c. A 2-dimensional array
d. A Byte array
9. An array can be infinitely long. 13. The equivalent of clauses in coding is?
a. Paragraphs
a. False
b. Statements
b. True
10. An array can be infinitely long. An array can be infinitely long. c. Blocks
c. Private 15. Constructed methods are initialized with 0 or null depending on the data type.
e. Directly a. True
g. Different forms
16. Conditional statements are the same as declaration statements.
h. Final
Select one:
i. Inheritance
a. True
j. Abstract class
12. The return value of the equals( ) method is ________ . b. False
17. The “1” in arrayName[1] is called an ________.
Select one:
Select one:
a. All of the choices
a. boolean
b. A double
b. any
c. An int
c. int[ ]
d. A string
d. Fills
e. None of the choices
e. Allocate
Select one:
f. Index
a. same
g. object
b. constructors
h. bytes
c. nesting
i. one
d. sub-classes
j. 3-d or 3-dimensional
e. methods
k. arraycopy( )
f. any number
l. can
g. classes
m. discouraged
h. inner class
n. 2-d or 2-dimensional
i. interchangeably
o. 255
j. cannot
Select one:
a. True
b. False
19. This type of declaration is discouraged: “int myArray[ ]”
Select one:
a. False
Select one:
20. _______ classes increase the encapsulation of you methods and data
Select one:
a. True
a. True
b. False
b. False
Select one:
a. decrement
26. If the increment “num = num + 2” is changed to “num = num + 1” the final output
will be _______. 30. An if-else-if-else statement is a block.
a. 12 a. True
b. 10 b. False
c. 2
31. The else statement can be removed if not needed.
d. 0
Select one:
27. The random( ) method sorts the array randomly. a. False
a. True
32. If-if is more logical than else-if.
b. False
Select one:
28. 1+2+3/4*5 is an unambiguous expression a. False
Select one:
b. True
a. False
Select one:
39. Ifs and else-ifs test expressions return true or false.
True
Select one:
False
a. True
Select one:
37. Overload methods must be the same name as the class
a. True
Select one:
b. False
a. True 44. Int num = 1; for(num=num;num<=10;num++) is an acceptable code snippet.
a. False
38. You can declare a new method in the subclass which is not declared in the
b. True
superclass.
45. The term of each pass through a loop makes is called?
c. go to the else statement
Select one:
d. skip the body
a. turn around
b. 3-d or 3-dimensional
46. The test expression of conditional statement cannot contain _______
c. Index
Select one:
d. object
a. !
e. Allocate
b. <
f. bytes
g. 255
47. The equals( ) method compares 2 arrays.
h. Fills
Select one:
i. int[ ]
a. True
j. boolean
b. False
k. 2-d or 2-dimensional
l. one
m. any
n. discouraged
b. produce an error
e. Fills
Question 1
Complete f. Allocate
Mark 1.00 out of 1.00
g. can
h. boolean
i. Index
j. 255
Flag question k. int[ ]
Question text l. discouraged
number++; is an expression m. one
Select one: n. object
a. False o. any
b. True Question 3
Complete
Question 2 Mark 1.00 out of 1.00
Complete
Mark 1.00 out of 1.00
Flag question
h. 3-d or 3-dimensional
i. bytes
j. object
k. int[ ] Flag question
l. can Question text
m. one
Please refer to figure 1 to answer the question below:
n. Allocate The output of println is _______
o. any
Question 4
Complete
Mark 1.00 out of 1.00
Remove flag
Question text
Which of these is a proper decrement?
Select one: Select one:
a. x-10; a. 55555
b. x++; b. 0
c. x c. error
d. x d. 12345
e. x -- 10
Question 6
f. x+-; Complete
Mark 1.00 out of 1.00
Flag question Flag question
Question 10
Complete
Mark 1.00 out of 1.00
b. False
Question 3
Complete
Mark 1.00 out of 1.00
Flag question
Question text
Another loop can be used as test expression.
Select one:
Select one:
a. less than
a. True
b. greater than or equal to
b. False
c. greater than
Question 4
d. less than equal to Complete
Mark 1.00 out of 1.00
Question 2
Complete
Mark 1.00 out of 1.00
Flag question
Question text
Flag question
_________ is also known as a parent class.
Question text
Select one:
Integer arrays can be populated with characters.
a. Abstract class
Select one:
b. Final
a. True
c. Inheritance
d. Different forms
e. Private
f. Directly
g. More than one
h. Parent class
i. Super class
j. Encapsulation
Question 5
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:
a. you
b. tralse
c. default
d. True
Question 6
Complete
Mark 1.00 out of 1.00
Flag question
Question text
Flag question
Please refer to figure 1 to answer the question below: The final
Question text value of num in the output is ________
Question 8
Complete
Mark 0.00 out of 1.00
Flag question
Remove flag
Question text
Question text
Please refer to Figure 2 to answer the question below:
Conditional test expressions can contain declarations The value of “pStr” in line 24 is _______.
Select one:
a. True Select one:
Question 9
Complete
a. tralse
Mark 1.00 out of 1.00 c. True
d. you
Flag question
Question text
Blocks can be one liner or huge classes.
Select one:
a. True
b. False
Question 10
Complete
Mark 0.00 out of 1.00
Please refer to Figure 2 to answer the question below:
c. case “me”:
The error in Figure 2 is _______.
d. no error
e. switch(str)
Question 2
Complete
Mark 1.00 out of 1.00
Flag question
Question text
“||” and “&&” can be used in conditional statements.
Select one:
a. False
b. True
Question 3
Complete
Mark 1.00 out of 1.00
Flag question
Question text
Question 4
Complete
Mark 1.00 out of 1.00
Flag question Flag question
Question text Question text
Loops can be stopped with a break; statement. Expressions can be statements.
Select one: Select one:
a. False a. False
b. True b. True
Question 5 Question 7
Complete Complete
Mark 1.00 out of 1.00 Mark 1.00 out of 1.00
Question 9
f. constructors
g. methods b. False
h. any number Question 16
i. inner class Complete
Mark 1.00 out of 1.00
j. classes
Question text
Question 12
Complete
Arrays can be read backwards
Mark 1.00 out of 1.00
Select one:
Question text a. False
Abstract classes cannot have nested classes. b. True
Select one: Question 17
a. False Complete
Mark 1.00 out of 1.00
b. True
Question text
Question 13
Complete
Parallelsorting utilizes ________.
Mark 1.00 out of 1.00
Select one:
Question text a. More cpu processing cores
Nesting classes increases encapsulation. b. More memory
Select one: c. More sorting methods
a. True d. The video card
b. False uestion 20
Complete
Question 14 Mark 1.00 out of 1.00
Complete
Mark 1.00 out of 1.00 Question text
Question text An abstract class must not contain abstract methods.
Abstracted methods already have implementations inside. Select one:
Select one: a. False
a. True b. True
Question 1 A nested class is not an inner class.
Complete
Mark 1.00 out of 1.00 Select one:
Question 4
Question text
Complete
Byte[ ] myArray is an array of _______.
Mark 1.00 out of 1.00
Question 9
Complete
Mark 1.00 out of 1.00
Question text
b. object
c. int[ ]
d. bytes
a. False j. discouraged
b. True k. Allocate
l. Fills
Question 16
Complete m. 2-d or 2-dimensional
Mark 1.00 out of 1.00
n. Index
Question text o. boolean
Constructors have 3 basic rules to follow.
Question 19
Select one: Complete
Mark 1.00 out of 1.00
a. False
Question text
b. True
A subclass constructor cannot invoke a superclass constructor.
Question 17
Select one:
Question 18
Complete a. True
Mark 1.00 out of 1.00
b. False
Question text
Question 20
Each index can only contain ________ element. Complete
Mark 1.00 out of 1.00
Select one:
Question text
a. any
A constructor can only have 1-2 overloads or parameters.
Select one:
a. True
b. False