I have java codes, please anyone can help me to build a interface for get PEEK and PUSH using those java class ??
Code:
public void push(Employee x){
stackArray[++top] = x;
}
public Employee peek(){
return stackArray[top];
}
public Employee pop(){
return stackArray[top--];
}
public boolean isEmpty(){
return (top == -1);
}
public boolean isFull(){
return (top == maxSize-1);
}
}
Code:
public class Employee{
private int empID;
private String empName;
private double salary;
public Employee(int empID, String empName, double salary) {
this.empID = empID;
this.empName = empName;
this.salary = salary;
}
public int getEmpID() {
return empID;
}
public String getEmpName() {
return empName;
}
public double getSalary() {
return salary;
}
}