exam questions

Exam 1z0-811 All Questions

View all questions & answers for the 1z0-811 exam

Exam 1z0-811 topic 1 question 8 discussion

Actual exam question from Oracle's 1z0-811
Question #: 8
Topic #: 1
[All 1z0-811 Questions]

Given the code fragment:

Which statement is true?

  • A. The code results in a compilation error. To make it compile, insert at line n1: import java.lang.Math; import java.lang.Random;
  • B. The code compiles successfully
  • C. The code results in a compilation error. To make it compile, insert at line n1: import java.lang; import java.util;
  • D. The code results in a compilation error. To make it compile, insert at line n1: import java.util.*;
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
darius123
6 months ago
Selected Answer: D
The correct answer is D. Random has to be imported explicitly from java.util.*
upvoted 1 times
...
tombatossals
11 months ago
Selected Answer: D
Correct answer is D. We must import Random, ArrayList and List from java.util
upvoted 1 times
...
filco72
11 months ago
public static void main(String[] args)
upvoted 1 times
...
filco72
11 months ago
It does not compile because of a syntax error in main method declaration: use parentheses instead of curly braces
upvoted 3 times
...
tabrezshaikh13
1 year ago
Selected Answer: D
D is the correct answer.
upvoted 1 times
...
falchetto
1 year, 2 months ago
java.lang.Math has to be imported in order to use Math.PI, correct answer is D
upvoted 1 times
...
LionNish
1 year, 5 months ago
The correct answer is D
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago