📄 employeedemo.java
字号:
public class Employeedemo
{
public static void main(String args[])
{
Employee tangcan=new Employee("唐灿",2400,2005,"13851797032");
tangcan.writeOutput();
Employee secondPerson=new Employee();
secondPerson.writeOutput();
secondPerson.setName("anotherPerson");
secondPerson.setSalary(2300);
secondPerson.setHiredDate(2003);
secondPerson.setSecurityNo("58742395");
secondPerson.writeOutput();
secondPerson.reset("唐灿",2400,2005,"13851797032");
secondPerson.writeOutput();
Employee thirdEmployee=getPerson();
if(tangcan.equals(thirdEmployee)){
System.out.println("the third employee is also tangcan");
}
else
System.out.println("the third employee is not tangcan");
}
public static Employee getPerson()
{
Employee anotherPerson=new Employee();
System.out.println("Please enter the information of the other person:");
System.out.print("name:");
anotherPerson.setName(SavitchIn.readLine());
System.out.print("salary:");
anotherPerson.setSalary(SavitchIn.readDouble());
System.out.print("hired date:");
anotherPerson.setHiredDate(SavitchIn.readInt());
System.out.print("securityNo:");
anotherPerson.setSecurityNo(SavitchIn.readLine());
return anotherPerson;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -