X1097: Debugging Scope- Fields

This Answer class stores an integer called value as a field. However, something is wrong with the constructor and it is not working correctly. Fix the problem.

Your Answer:

x
 
1
public class Answer
2
{
3
    private int value;
4
5
    public Answer(int v)
6
    {
7
        int value = v;
8
    }
9
10
    public int getValue()
11
    {
12
        return this.value;
13
    }
14
}
15

Feedback

Your feedback will appear here when you check your answer.