exam questions

Exam 1z0-808 All Questions

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

Exam 1z0-808 topic 1 question 83 discussion

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

Given the code fragment:

What is the result if the integer aVar is 9?

  • A. Compilation fails.
  • B. 10 Hello Universe!
  • C. 10 Hello World!
  • D. 9 Hello World!
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

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
v323rs
Highly Voted 5 years ago
The correct answer C 10 Hello World!
upvoted 8 times
...
iSnover
Highly Voted 2 years, 3 months ago
The corrent answer is B. Because when have "++" after of the variable as "aVar++" is added +1 when exit of the lace and i've tested the cod and return letter B.
upvoted 7 times
...
MPignaProTech
Most Recent 3 months ago
a fragment code is missing
upvoted 1 times
...
dsms
1 year, 5 months ago
Answer is: 10 Hello Universe!
upvoted 1 times
...
Vicky_65
1 year, 9 months ago
Selected Answer: B
B is correct one.
upvoted 2 times
...
CreazyyyyGirl
1 year, 10 months ago
Selected Answer: B
Correct answer is B. Tested
upvoted 2 times
...
Ripfumelo
2 years ago
--- exec-maven-plugin:3.0.0:exec (default-cli) @ mavenproject42 --- 10 Hello Universe! ------------------------------------------------------------------------ BUILD SUCCESS ------------------------------------------------------------------------ Total time: 1.075 s Finished at: 2023-01-10T10:27:57+02:00 -------------------------
upvoted 1 times
...
carloswork
2 years, 2 months ago
Selected Answer: B
Tested. Answer is B. Source code: public static void main(String[] args) { int aVar = 9; if(aVar++ < 10) { System.out.println(aVar + " Hello Universe!"); } else { System.out.println(aVar + " Hello World!"); } }
upvoted 3 times
...
shivkumarx
2 years, 4 months ago
It seems noone here knows post and pre-increment. if aVar =9 then aVar++ < 10 evaluates to 9 <10, therefore B is correct (tested).
upvoted 3 times
...
Saran2021
3 years, 7 months ago
Answer is C
upvoted 1 times
...
Roy25
4 years, 1 month ago
Correct
upvoted 1 times
...
JoseCG
5 years, 2 months ago
Correct.
upvoted 5 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