updated Person2.java with required method