Java - Encapsulation
What will be the output of the following code?
public class Person {
private String name;
public String getName() { return name; }
public void setName(String name) { this.name = name; }
public static void main(String[] args) {
Person p = new Person();
p.setName("Alice");
System.out.println(p.getName());
}
}