Exam 2: Fundamental Data Types

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

Assuming that the user enters 45 and 62 as inputs for n1 and n2, respectively, what is the output of the following code snippet? Public static void main(String[] args) { System.out.print("Enter a number: "); Scanner in = new Scanner(System.in); String n1 = in.next(); System.out.print("Enter another number: "); String n2 = in.next(); String result = n1 + n2; System.out.print(result); }

(Multiple Choice)
4.8/5
(40)

What is the result of the following expression? Double d = 2.5 + 4 * -1.5 - (2.5 + 4) * -1.5;

(Multiple Choice)
4.9/5
(45)

Which of the following options defines an integer variable?

(Multiple Choice)
4.9/5
(43)
Showing 101 - 103 of 103
close modal

Filters

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