Practice · 5 of 8
MCQ: What is the value of `new Priced(40).get()`?
CHALLENGE
Difficulty: advanced+25 XP
What is the value of new Priced(40).get()?
``java
public class Priced {
private int price;
public Priced(int price) { price = price; }
public int get() { return price; }
}
``
A. 40
B. compile error
C. 0
D. runtime exception
Print your answer as: the option letter, then your explanation of why it is correct and why each other option is wrong. First line must start with the letter.
Press Submit to check your solution.
Back to lesson: Practice: MCQ set 1: read the misconception