Java - Setters from Constructors
问题 package cen.col.course.demo; import java.io.Serializable; public class Course implements Serializable { private static final long serialVersionUID = 1L; protected String code; protected String title; protected Professor professor; public Course( String code) throws InvalidDataException { super(); setCode(code); } public Course(String code, String title ) throws InvalidDataException { this(code); setTitle(title); } public Course(String code, String title, Professor professor) throws