Replace Subclass with Fields

You have subclasses that vary only in methods that return constant data.

Change the methods to superclass fields and eliminate the subclasses.

image/svg+xml Person getCode() Male getCode() Female getCode() return 'M'; return 'F'; Person getCode() code