exam questions

Exam 1z0-819 All Questions

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

Exam 1z0-819 topic 1 question 40 discussion

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

Given the code fragment:

What is the result?

  • A. The compilation fails due to an error in line 2.
  • B. 201
  • C. de
  • D. 203
  • E. The compilation fails due to an error in line 3.
  • F. The compilation fails due to an error in line 1.
Show Suggested Answer Hide Answer
Suggested Answer: E 🗳️

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
5 months, 2 weeks ago
Selected Answer: B
if you don't notice the syntax error on line 3, то //is ok according to Implicit narrowing char d = 100 //returns "int" according to Numeric Promotion Rules (char) x + (char)y
upvoted 1 times
...
[Removed]
8 months, 2 weeks ago
Selected Answer: B
Correct answer is B i did run it and it print 201
upvoted 1 times
...
[Removed]
1 year, 5 months ago
E is correct. int = won't compile
upvoted 1 times
...
Stavok
1 year, 7 months ago
Selected Answer: E
E is correct Tested
upvoted 1 times
...
Jtic
1 year, 11 months ago
Selected Answer: E
char d = 100, e = 'e' ; // line 1 int x = d ; // line 2 int y = (int) e; // line 3 System.out.println ((char) x + (char) y) ;
upvoted 1 times
...
RP384
1 year, 11 months ago
Selected Answer: E
"int =" will fail
upvoted 1 times
...
Obalt
1 year, 11 months ago
There is a minor error on line 3. Should be int y = (int)e. Then B is correct answer
upvoted 1 times
KiraguJohn
1 year, 9 months ago
That minor error on line 3 is intentional otherwise an examiner would not expect you to know the ASCII code for all characters.
upvoted 2 times
...
...
Obalt
1 year, 11 months ago
Correct answer is B
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