Hanmin
Daewook
Jiwoo
100

The purpose of a(n) ____________________ statement is to group several statements together to form a single statement.

Block

100

A (n) ____________________ defines a blueprint for creating objects with fields and methods.

Class

100

Which keyword is used to create a new object from a class?

New

200

!(a < b) is equivalent to ____________________.

a >= b

200

A variable defined within a class for which each instance has its own value is called a(n)

Instance Variable

200

A method that is called when an object is instantiated to initialize its fields is known as a(n)

Constructor

300

What does the this keyword refer to in a Java class?

The current instance (object) of the class.

300

Which of the following are primitive data types?
I. double
II. String
III. boolean

I and III only



300

Consider the following code segment.
int m = 8;
int n = 3;
if (m + n > 10)
{
System.out.print(m + n);
}
if (m - n > 0)
{
System.out.print(m - n);
}
What, if anything, is printed as a result of executing the code segment?

115

400

Consider the following code segment.
boolean a = true;
boolean b = false;
System.out.print((a == !b) != false);
What is printed as a result of executing this code segment?

A) false

B) true

C) truly false

D) Zisung

B

400
True or False


Hanmin is a Genius

True

400

A programmer needs to produce a random int n in the range 20 ≤ n ≤ 30. A statement that does this correctly is

A. int n = 10*Math.random() + 20;
B. int n = 11*Math.random() + 20;
C. int n = (int) (Math.random()) + 20;
D. int n = (int) (Math.random() * 11) + 20;
E. int n = (int) (Math.random() * 10) +
 

D

500

Write the Java version of the following pseudocode: If the student's grade is between 60 and 70 (inclusive), print "C".

if (grade >= 60 && grade <= 70) System.out.println("C");

500

make a code to solve this

Math.sqrt(Math.pow(x + y, 2) / Math.abs(a - b))

500

Assume that the following variable declarations have been made.
double d = Math.random();
double r;

What expression assigns a value to r from the uniform distribution over the range 0.5 ≤ r < 5.5 ?

r = d * 5.0 + 0.5;

M
e
n
u