MyClass.java
Person.java
 

public class MyClass {
  public static void main(String[ ] args) {
    Person myObj = new Person();
    myObj.setName("John");
    System.out.println(myObj.getName());
  }
}

Result:
John