Question PRG-JAVA-0054
MediumWhat happens when Integer x = null; int y = x; runs?
- A.
Compilation error
- B.
y becomes null
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Java question
What happens when Integer x = null; int y = x; runs?
Compilation error
y becomes null
Sign up free to see the answer and a step-by-step explanation.
y becomes 0
A NullPointerException during unboxing