Java - Classes and Objects
Identify the error in the following code snippet:
class Person {
String name;
Person(String n) {
name = n;
}
}
public class Test {
public static void main(String[] args) {
Person p = Person("Alice");
System.out.println(p.name);
}
}