Module 2

Ace your homework & exams now with Quizwiz!

What is the result of the following expression?10 + 5 * 3 - 20

5

What is the value of z after the following statements have been executed? int x = 4, y = 33;double z;z = (double) (y / x);

8.0

Which of the following is NOT true about identifiers in Java?

Identifiers can contain white spaces

Which of the following statements correctly creates a Scanner object for keyboard input?

Scanner keyboard = new Scanner(System.in);

To print "Hello, world" on the monitor, which of the following Java statements should be used?

System.out.println("Hello, world");

For the following code, which statement is NOT true? public class Sphere { private double radius; public double x; private double y; private double z; }

The z field is available to code written outside the Sphere class.

What would be displayed as a result of executing the following code? int x = 578;System.out.print("There are " + (x + 5) + " hens in the hen house.");

There are 583 hens in the hen house.

It is common practice in object-oriented programming to make all of a class's

fields private.

The scope of a local variable is:

the method in which it is defined.

The primitive data types only allow a(n) ________ to hold a single value.

variable


Related study sets

Research Methods Exam 1 Quiz Review

View Set

PREPU: CH 61 MANAGEMENT OF PATIENTS WITH NEUROLOGIC DYSFUNCTION

View Set

MG 485 Module 2 In-Depth Questions - Chapter Assignment Questions & Check Your Knowledge

View Set

Sadlier Vocabulary Workshop Level F Unit 2 Answers

View Set

Populations in Research Requiring Additional Considerations and/or Protections

View Set

Ch 58: Professional Roles and Leadership

View Set

Module 13- Travel Planning, Loading, Towing and Driving Special Vehicles

View Set

Fizica, clasa a VI-a, Proprietăți fizice

View Set