employeedemo.java

来自「homework : ) 找不到源码」· Java 代码 · 共 47 行

JAVA
47
字号
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 + =
减小字号Ctrl + -
显示快捷键?