exam questions

Exam 1z0-819 All Questions

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

Exam 1z0-819 topic 1 question 62 discussion

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

Given:



What is the output?

  • A. Short value 25
  • B. The compilation fails due to an error in line 1.
  • C. Byte value 25
  • D. Object value 25
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
ASPushkin
6 months, 1 week ago
Selected Answer: D
answer: D x+y = int - numeric promotion rule [2]method signature parameter 1. first phase without boxing/unboxing there is no match type/ there is no widdening type 2. phase allowing boxing and unboxing int -> Integer (autoboxing) Integer->Object //regular downcasting No explicit cast is necessary
upvoted 1 times
...
mendjijet
12 months ago
Selected Answer: D
tested : D x+y => boxed to int and boxed to Integer
upvoted 1 times
...
Omnisumem
1 year, 4 months ago
Selected Answer: D
Tested: D.
upvoted 1 times
...
tmuralimanohar
1 year, 7 months ago
Answer: D x+y becomes int
upvoted 1 times
...
Stavok
1 year, 8 months ago
Selected Answer: D
D is correct TESTED
upvoted 2 times
Stavok
1 year, 6 months ago
The output of the code is D. Object value 25. The code compiles and runs without any errors. In the expression x+y, both operands are promoted to int before the addition is performed, resulting in an int value of 25. Since there is no process method that takes an int argument, the int value is then boxed into an Integer object and passed to the process(Object v) method, which prints Object value 25.
upvoted 4 times
...
...
Mukes877
1 year, 8 months ago
Selected Answer: D
D is correct because Object class is base class for every object.
upvoted 2 times
...
Obalt
1 year, 12 months ago
The correct answer is D
upvoted 1 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