Code:
package vbcalc;
import java.util.LinkedList;
import java.util.Stack;
import java.util.*;
/**
*
* @author savant
*/
public class ListStack implements Stack
{
boolean aBoolean = true;
private Lijst lijst;
public ListStack()
{
lijst = new Lijst();
}//End method
public void push()
{
lijst.addLast(this);
}
public Object pop()
{
return lijst.removeFirst();
}//End method
public Object peek()
{
return (lijst.getLast());
}
public int size()
{
return lijst.size();
}//End method
public boolean isEmpty()
{
return lijst.isEmpty();
}//End method
}//End classe
Code:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package vbcalc;
/**
*
* @author savant
*/
public interface Stack
{
public void push( Object o );
public Object pop();
public Object peek();
public int size();
public boolean isEmpty();
}
maar nu geeft ie nog steeds de volgende error:
interface expected here:
bij deze regel:
Code:
public class ListStack implements Stack
Alvast enorm bedankt.