exam questions

Exam 1z0-811 All Questions

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

Exam 1z0-811 topic 1 question 23 discussion

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

Given:

What is the result?

  • A. 100
    200
  • B. A compilation error occurs at line n2.
  • C. A compilation error occurs at line n1.
  • D. 100
    100
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
tabrezshaikh13
Highly Voted 2 years ago
Correct option is not present. Output is 100 300
upvoted 5 times
...
ahmed_alshehhi
Most Recent 2 months, 2 weeks ago
Selected Answer: A
obj.print(100) is called. Inside print(int var1) • System.out.println(var1); prints 100. • var2 = var2 + var1; → 200 + 100 = 300, so the static field var2 becomes 300. • print(); invokes the static overload, which prints the current value of var2 (now 300). Thus the sequence is 100 then 300, so none of the listed choices match; the correct result is 100 followed by 300.
upvoted 1 times
...
electri
7 months, 1 week ago
Selected Answer: A
I ran it in a compiler its definitly 100 300 So no answer is correct, i guess A is the right answer but it has a typo
upvoted 2 times
...
nosferatu31
8 months, 1 week ago
100 300
upvoted 2 times
...
arjunec1
2 years, 6 months ago
Selected Answer: D
The option D should be updated with the value: 100 300
upvoted 2 times
...
arjunec1
2 years, 6 months ago
the answer is: 100 300
upvoted 2 times
...
DobrevD
2 years, 7 months ago
Hello I guess the Answer on this question should be 100 300
upvoted 4 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 ...