Basic Array based stack in java Here is an array based stack. I tried to implement this basic stack from memory. I want to make sure it is correct.

import java.util.*;

public class Stack{
    private int[] stack;
    private int size;

    public Stack(){
        stack = new int[5];
        int size = 0;
    }

    public Stack(int capacity){
        stack = new int[capacity];
        int size = 0;
    }

    public void push(int pushedValue){
        if(size == stack.length){
            throw new fullStackException();
        }
        stack[size] = pushedValue;
        size++;
    }

    public int pop(){
        if(size == 0){
            throw new emptyStackException();
        }
        int poppedValue = stack[size - 1];
        size--;
        return poppedValue;
    }

    public int peek(){
        if(size == 0){
            throw new emptyStackException();
        }
        return stack[size - 1];
    }

    private class emptyStackException extends RuntimeException{
        public emptyStackException(){
            super();
        }
    }

    private class fullStackException extends RuntimeException{
        public fullStackException(){
            super();
        }
    }

}
Well, it seems to be ok, a simple unit test prove it works. 

However, using such private exceptions is not a good idea because nobody can catch them. You should also use the CamelCase name for those exceptions and maybe provide more context information to those exceptions.