How to compare the current token with upcoming or previous token using Scanner (or some alternative)?

Printable View