Answer:
public class FullName {
private String givenName;
private String familyName;
//The constructor
public FullName(String givenName, String familyName) {
this.givenName = givenName;
this.familyName = familyName;
}
//Method toString
public String toString(){
String fullName = familyName+", "+givenName;
return fullName;
}
}
Step-by-step explanation:
As required by the question. A class is created with two fields
private String givenName;
private String familyName;
The constructor initializes the values for this fields
The method toString concatenates the familyName and givenName and returns the fullName