Question from the Java and Craftsmanship test

Compare two Java classes with the same fields and methods.

Medium

Let's consider

public class Firstname {

  private final String firstname;

  public Firstname(String firstname) {
    this.firstname = firstname;
  }

  public String firstname() {
    return firstname;
  }
}
public record Firstname(String firstname) {

}

These structures

Author: Clément DevosStatus: PublishedQuestion passed 283 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!