/* * Task 2 * * 1. Implement all the missing methods in MyStack. * 2. Implement the MyQueue class using the provided Queue interface. * 2a. You should use two stacks (MyStack) to implement the MyQueue methods. */ package task02; interface Stack { public abstract int pop(); public abstract void push(int i); public abstract boolean isEmpty(); } class MyStack implements Stack { public MyStack() { } public int pop() { } public void push(int i) { } protected class StackException extends RuntimeException { private static final long serialVersionUID = 1L; public StackException(String s) { super(s); } } public boolean isEmpty() { } public String toString() { } } interface Queue { public abstract void enqueue(int i); public abstract int dequeue(); public abstract boolean isEmpty(); }
Ok so the first question i have is about the
public abstract int pop();
public abstract void push(int i);
public abstract boolean isEmpty();
Basically i dont understand what the abstract means. I've learnt about abstract classes before and why they should be abstract, but havnt dealt with abstracts in declaring variables.
And the 2nd but main question i have is about the private static final long serialVersionUID = 1L thing. Ive googled that and some of the explanations i got were so full of technical terms i had no idea what they were saying. Please enlighten me =]