So, I have the following class:
public class Person
{
private String firstName;
private String lastName;
public Person()
{
}
public Person(String first, String last)
{
this.firstName = first;
this.lastName = last;
}
}
I'm aware that if I make the variables 'protected' or 'public' rather than 'private', I'll be able to access them from another class without mutator/accessor methods. Given how the code is now, is it possible to access these private variables from another class without using the aforementioned methods? Any help would be greatly appreciated!
Thanks,
Mark