java structure example

java structure example
refer t‮l:o‬autturi.com
class Employee {
    private String name;
    private int eid;

    // constructor
    public Employee(String name, int eid) {
        this.name = name;
        this.eid = eid;
    }

    // getter
    public String getName() { return name; }
    public int geteid() { return eid; }
    
    // setter
    public void setName(String name) { this.name = name; }
    public void seteid(int eid) { this.eid = eid; }
}

Employee[] arr = new Employee[20];
arr[0] = new Employee("Gambardella,Matthew", 101); 
arr[1] = new Employee("Corets, Eva", 102);
Created Time:2017-09-30 20:39:37  Author:lautturi