Amazon interview question

Re-implement the parseInteger method in java