Yes exactly. When you are using a getter method, you have to specify a return type in that method. that is how you will "get" any value right?
like micheal said, change the getter method to String getName(), return a string value from this. It could be like:
String getName()
{
String n = Keyboard.readString();
return n;
}
In your main method get the value by:
p1.name = p1.getName();
p2.name = p2.getName();