Filters
Question type

Study Flashcards

What does the expression x %= 10 do?


A) Adds 10 to the value of x, and stores the result in x.
B) Divides x by 10 and stores the remainder in x.
C) Divides x by 10 and stores the integer result in x.
D) None of the above.

E) C) and D)
F) A) and B)

Correct Answer

verifed

verified

What is the size in bits of an int?


A) 8
B) 16
C) 32
D) 64

E) A) and B)
F) All of the above

Correct Answer

verifed

verified

Which of the following terms is not used to refer to a sentinel value that breaks out of a while loop?


A) signal value.
B) maximum value.
C) dummy value.
D) flag value.

E) All of the above
F) B) and C)

Correct Answer

verifed

verified

Which of the following statements about the conditional operator (?:) is false?


A) The conditional operator is a ternary operator, meaning that it takes three operands.
B) The first operand is a boolean expression.
C) The second operand is the result value if the condition evaluates to false.
D) The second operand is the result value if the condition evaluates to true.

E) C) and D)
F) None of the above

Correct Answer

verifed

verified

Which of the following is the shape of an action-state symbol?


A) Diamond.
B) Circle.
C) Rectangle with left and right sides replaced with arcs curving outward.
D) Rounded rectangle.

E) B) and C)
F) A) and B)

Correct Answer

verifed

verified

Which of the following is not a Java keyword?


A) do
B) next
C) while
D) for

E) B) and C)
F) A) and D)

Correct Answer

verifed

verified

What is the result value of c at the end of the following code segment? Int c = 8; C++; ++c; C %= 5;


A) 0.
B) 1.
C) 3.
D) None of the above.

E) A) and B)
F) B) and D)

Correct Answer

verifed

verified

Keyword ________ indicates the inheritance relationship.


A) extends
B) inherits
C) super
D) parent

E) B) and C)
F) None of the above

Correct Answer

verifed

verified

Java is considered a strongly typed language because:


A) The primitive types in Java are portable across all computer platforms that support Java.
B) Java requires all variables to have a type before they can be used in a program.
C) Instance variables of the primitive types are automatically assigned a default value.
D) All of the above.

E) All of the above
F) A) and B)

Correct Answer

verifed

verified

In Java graphics, coordinate units are measured in ________.


A) pixlets.
B) pixels.
C) points.
D) pikels.

E) A) and B)
F) B) and D)

Correct Answer

verifed

verified

Which of the following is a double-selection control statement?


A) do…while
B) for
C) if…else
D) if

E) B) and D)
F) A) and B)

Correct Answer

verifed

verified

Which of the following operators associates from left to right?


A) (=)
B) (?:)
C) (%=)
D) (/)

E) A) and B)
F) A) and C)

Correct Answer

verifed

verified

Local variables must be ________.


A) initialized when they're declared.
B) initialized before their values are used in an expression.
C) declared and initialized in two steps.
D) declared at the top of the method's body.

E) All of the above
F) A) and B)

Correct Answer

verifed

verified

What is output by the following Java code segment? Int temp = 180; While (temp != 80) { If (temp > 90) { System.out.print("This porridge is too hot! ") ; // cool down Temp = temp - (temp > 150 ? 100 : 20) ; } Else { If (temp < 70) { System.out.print( "This porridge is too cold! ") ; // warm up Temp = temp + (temp < 50 ? 30 : 20) ; } } } If (temp == 80) System.out.println("This porridge is just right!") ;


A) This porridge is too cold! This porridge is just right!
B) This porridge is too hot! This porridge is just right!
C) This porridge is just right!
D) None of the above.

E) B) and D)
F) B) and C)

Correct Answer

verifed

verified

Counter-controlled repetition is also known as:


A) Definite repetition
B) Indefinite repetition
C) Multiple-repetition structure
D) Double-repetition structure

E) C) and D)
F) None of the above

Correct Answer

verifed

verified

How many times is the body of the loop below executed? Int counter = 1; While (counter > 20) { // body of loop Counter = counter - 1; } // end while


A) 19.
B) 20.
C) 21.
D) 0.

E) A) and B)
F) A) and C)

Correct Answer

verifed

verified

Which of the following statements is false?


A) To ensure that the operands in a mixed-type expression are of the same type, Java performs implicit conversion on selected operands.
B) Cast operators are unary operators.
C) Cast operators associate from right to left and are one level lower in precedence than the multiplicative operators.
D) Cast operators are formed by placing parentheses around the name of a type.

E) A) and D)
F) A) and C)

Correct Answer

verifed

verified

A decision symbol in an activity diagram takes the shape of a ________.


A) Diamond.
B) Rectangle.
C) Circle.
D) Triangle.

E) None of the above
F) C) and D)

Correct Answer

verifed

verified

Which of the following is not a benefit of "goto-less programming"?


A) Easier to debug and modify
B) Shorter
C) Clearer
D) More likely to be bug free

E) A) and B)
F) B) and C)

Correct Answer

verifed

verified

Showing 21 - 39 of 39

Related Exams

Show Answer