谢谢了xxxxx2005-03-23 06:46:25
我是新手, 在自学java, 还是有些糊涂, 请问谁知道怎么写啊?
关键是第7步不知道怎么写

Write a class Name that stores a person's first, middle, and last names and provides the following methods:

1. public Name(String first, String middle, String last) -- constructor. The name should be stored in the case given; don't convert to all upper or lower case.

2. public String getFirst() -- returns the first name.

3. public String getMiddle() -- returns the middle name.

4. public String getLast() -- returns the last name.

5. public String firstMiddleLast() -- returns the person's full name in order, e.g., "Mary Jane Smith".

6. public String lastFirstMiddle() -- returns the person's full name with the last name first followed by a comma, e.g., "Smith, Mary Jane".

7. public boolean equals(Name otherName) -- returns true if this name is the same as otherName. Comparisons should not be case sensitive. (Hint: There is a String method equalsIgnoreCase that is just like the String method equals except it does not consider case in doing its comparison.)

8. public String initials() -- returns the person's initials (a 3-character string). The initials should be all in upper case, regardless of what case the name was entered in.

9. public int length() -- returns the total number of characters in the full name, not including spaces.
你是哪个学校的
xunqi2005-03-23 11:56:52
回复:求教: 关于java, 真是不太明白
sgnx2005-03-23 15:40:45
回复:求教: 关于java, 真是不太明白
Java鉴定家2005-03-23 17:06:26
This is a good one, last is 乱弹