Code example for EmptyStackException

0
            throw new IllegalArgumentException("Строка имела неверный формат");
        } 
 
        if (stack.size()<2)
        { 
            throw new EmptyStackException();
        } 
 
        Double num1 = stack.pop();
        Double num2 = stack.pop();
        stack.push(getResult(num2, num1));
    } 
} 
Contextual code suggestions in your IDE  Get Codota for Java