Oracle
1Z0-850 · Question #4
Given: 3. int calc() { 4. long x = 40L; 5. int i = 30; 6. x = w; 7. System.out.println("result is: " + i); 8. } What is the result of calling calc()?
The correct answer is A. Compilation fails because of an error at line 6. See the full explanation below for the reasoning.
Question
Given:
3. int calc() {
4. long x = 40L;
5. int i = 30;
6. x = w;
7. System.out.println("result is: " + i);
8. }
What is the result of calling calc()?
Options
- ACompilation fails because of an error at line 6.
- BCompilation fails because of an error at line 4.
- CResult is: 40
- DResult is: 30
How the community answered
(24 responses)- A75% (18)
- B13% (3)
- C8% (2)
- D4% (1)
Community Discussion
No community discussion yet for this question.