importjava.util.Scanner;publicclassadd{intmax=0;Test[]arr=newTest[400];publicTestaddwork(){Scannerinput=newScanner(System.in);System.out.println("输入工号");intnum=input....
import java.util.Scanner;
public class add {int max=0;Test[] arr=new Test[400];
public Test addwork(){
Scanner input=new Scanner(System.in);System.out.println("输入工号");int num=input.nextInt();System.out.println("输入名字");String name=input.next();System.out.println("输入电话号码");int phonenum=input.nextInt();System.out.println("输入地址");String address=input.next();System.out.println("输入工作");String zhiwei=input.next();Test t=new Test(num, name, phonenum, address, zhiwei);if(t!=null){ arr[max] = t;System.out.println((Object)(arr[max]));max++;}return arr[max];
}public void show(){
for(int i=0;i
}public void close(){}}
展开