Oracle
1Z0-803 · Question #109
1Z0-803 Question #109: Real Exam Question with Answer & Explanation
The correct answer is B: Change line 5 to:. See the full explanation below for the reasoning.
Question
Given: 1. public class Simple { 2. public float price; 3. public static void main (String [] args) { 4. Simple price = new Simple(); 5. price = 4; 6. } 7. } Which will make this code compile and run?
Options
- AChange line 5 to:
- BChange line 5 to:
- CChange line 5 to:
- DChange line 5 to:
- EThe code compiles and runs properly; no changes are necessary.
Community Discussion
No community discussion yet for this question.