⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 author.java

📁 beginJsp2.0外文书籍源代码
💻 JAVA
字号:
package books;

public class Author
{

  private String lastName;
  private String firstName;
  private String otherNames;

  public void setName(String firstName, 
                      String lastName,
                      String otherNames)
  {
    this.lastName = lastName;
    this.firstName = firstName;
    this.otherNames = otherNames;
  }

  public void setName (String lastName, String firstName)
  {
// rather than duplicating functionality of the overloaded method like so:
//    this.lastName = lastName;
//    this.firstName = firstName;
//    this.otherNames = "";
// it is preferable to call the overloaded method like this:

    this.setName (lastName, firstName, "");
  }

  public String getName()
  {
    return firstName + " " + otherNames + " " + lastName;
  }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -