employee.htm
来自「Thinking in C 电子书的源代码」· HTM 代码 · 共 44 行
HTM
44 行
<html><font size="+1"><pre>
// Employee.java
public class Employee {
private String last;
private String first;
private String title;
private int age;
public Employee(String l, String f,
String t, int a) {
last = l;
first = f;
title = t;
age = a;
}
public String toString() {
return "{" + last + "," + first +
"," + title+ "," + age + "}";
}
public void setLast(String s) {
last = s;
}
public void setFirst(String s) {
first = s;
}
public void setTitle(String s) {
title = s;
}
public void setAge(int n) {
age = n;
}
public static void main(String[] args) {
Employee e = new Employee("Jordan", "Michael",
"Guard", 37);
System.out.println(e);
e.setLast("Malone");
e.setFirst("Karl");
e.setTitle("Center");
e.setAge(36);
System.out.println(e);
}
}
</pre></font></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?