Exam 2: Data and Expressions

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

The print and the println methods are identical and can be used interchangeably.

(True/False)
4.8/5
(50)

Consider the expression: result = 15 % 4; What value stored in result after this line is executed?

(Multiple Choice)
4.7/5
(49)

Promotion is a widening data conversion that is explicitly requested by the programmer.

(True/False)
4.8/5
(36)

Variables declared with the final modifier cannot have new values assigned to them.

(True/False)
4.8/5
(39)

Write an application that prints out the following using a single call to the print method. Hello! How are you?

(Essay)
4.7/5
(42)

Which of the following is not an arithmetic operation in Java?

(Multiple Choice)
4.9/5
(34)

Consider the following snippet of code: System.out.println("30 plus 25 is " + 30 + 25); What is printed by this line?

(Multiple Choice)
4.7/5
(34)

Java is a strongly-typed language.

(True/False)
4.9/5
(38)

The byte type can be assigned a larger range of numbers than the int type.

(True/False)
4.8/5
(36)

In order to make a variable a constant which modifier must be included in its declaration?

(Multiple Choice)
4.8/5
(37)

Write a single line of Java code that computes the average of three integer variables - num1, num2, and num3 - and stores the result in a variable of type double called result.

(Essay)
4.7/5
(36)

What are some reasons that you might want to declare a variable as final?

(Essay)
4.9/5
(41)

Write a short application that computes the perimeter of a rectangle. It should allow the user to input the length and width of the rectangle as a double.

(Essay)
4.9/5
(34)

Consider the following snippet of code: Consider the following snippet of code:   What values are stored in firstNum, secondNum and thirdNum after these lines are executed? Explain your answer. What values are stored in firstNum, secondNum and thirdNum after these lines are executed? Explain your answer.

(Essay)
4.9/5
(45)

How are primitive data types and object data types related?

(Short Answer)
4.8/5
(38)

Java uses the ASCII character set to represent character data.

(True/False)
4.8/5
(38)

For the following expression, indicate the order that in which the operators will be evaluated. a + b * c / (d - e)

(Short Answer)
4.8/5
(39)

Java has two basic kinds of numeric values: _____________, which have no fractional part, and ___________________ which do.

(Multiple Choice)
4.7/5
(27)

Consider the following snippet of code. int iResult; Consider the following snippet of code. int iResult;   What values are stored in iResult, rResult and fResult? Explain your answers. What values are stored in iResult, rResult and fResult? Explain your answers.

(Essay)
4.9/5
(44)

Which of the following is an example of an invalid expression in Java?

(Multiple Choice)
4.7/5
(34)
Showing 21 - 40 of 40
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)