RPN Calculator in Java — A Practical Stack Implementation

Steve Pesce
3 min readNov 22, 2020

After last weeks blog post, What is a Stack and how to Create one in Java, I figured it would be nice to give a practical example of using a stack in Java.

Reverse Polish Notation (also known as Postfix Notation) is a different way to write mathematical expressions. Normally, we use Infix notation to write algebraic expressions, where operators are between operands. While RPN expressions may be difficult to understand at first, they simplify algebraic expressions due to RPN doing away with parenthesis and the order of operations.

--

--