exam questions

Exam 1z0-808 All Questions

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

Exam 1z0-808 topic 1 question 118 discussion

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

Given:

And given the code fragment:

What is the result?

  • A. 300:300 200:300
  • B. 300:100 200:300
  • C. 300:0 0:300
  • D. 100:300 300:200
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
sina_
6 months, 1 week ago
class test07{ public static int stvar = 100; public int var = 200; public String toString(){ return stvar + ":" + var; } public static void main(String[] args) { test07 t1 = new test07(); t1.var= 300; System.out.println(t1); test07 t2 = new test07(); t2.stvar =300; System.out.println(t2); } }
upvoted 1 times
...
iSnover
1 year, 3 months ago
Selected Answer: D
The answer is the letter D. Even though stVar is static, but it was printed before receiving the new value, so in line 3 it still had the value of 100.
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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago