Why does the following code cause a NullPointerException?
1 public class Test {
2 private String text;
3
4 public Test(String s) {
5 String text = s;
6 }
7
8 public static void main(String[] args) {
9 Test test = new Test("ABC");
10 System.out.println(test.text.toLowerCase());
11 }
12 }
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.