Java - Classes and Objects
What will be the output of this Java code?
class Person {
String name;
Person(String n) {
name = n;
}
}
public class Main {
public static void main(String[] args) {
Person p = new Person("Alice");
System.out.println(p.name);
}
}