Vous êtes sur la page 1sur 1

/**

* Write a description of class StackX here.


*
* @author (your name)
* @version (a version number or a date)
*/
import java.io.*;
class StackX
{
public int maxSize = 10;
public char stackArray[];
public int stack;
int top;
public StackX(int max)
{
max = maxSize;
char[] stackArray = new char[maxSize];
int top = -1;
}

public void push(char j)


{
stackArray[++top] = j;
}
public char pop()
{
return stackArray[top--];
}
public char peek()
{
return stackArray[top];
}
public boolean isEmpty()
{
if(isEmpty())
return true;
else
return false;
}
}

***************

Vous aimerez peut-être aussi