我对以下代码有疑问...
/**
* This class holds all of the information pertaining to
* a person's name.
*/
public class Name {
private String first, middle, last, maiden, initials, prefix, suffix;
private char middleInitial, firstInitial, lastInitial;
private
/**
* Constructor for a Name given first, middle, and last names.
*/
public Name(String first, String middle, String last) {
this.first = first;
this.middle = middle;
this.last = last;
this.middleInitial = middle.charAt(0);
this.firstInitial = first.charAt(0);
this.lastInitial = last.charAt(0);
this.initials = String.valueOf(firstInitial + middleInitial
+ lastInitial);
this.maiden = null;
this.prefix = null;
this.suffix = null;
}
还有更多,但我的错误出现在我的主要构造函数中。它给了我在标题中输入的错误。如您所见,我的类和构造函数都是公共的。这不应该引起任何问题,但似乎正在这样做。