exam questions

Exam 1z0-808 All Questions

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

Exam 1z0-808 topic 1 question 161 discussion

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

Given:

What is the result?

  • A. Welcome Visit Count:0 Welcome Visit Count: 1
  • B. Compilation fails at line n2.
  • C. Compilation fails at line n1.
  • D. Welcome Visit Count:0 Welcome Visit Count: 0
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

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
MPignaProTech
2 months, 3 weeks ago
Selected Answer: C
count is not static
upvoted 1 times
...
TOPPSI
2 years ago
C: compilation fail in line n1 Reason: Non-static field 'count' cannot be referenced from a static context
upvoted 1 times
...
iSnover
2 years, 3 months ago
Selected Answer: C
The answer is the letter C and I will explain, this type of question I already noticed by the simulated ones that falls a lot in the OCA exam, you can't make additions with "++" operators like "++count" or "count++" in a static method with a normal instance variable. For the code to compile, the "count" instance variable must be static.
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