You might want to post the Console class in tio aswell, I tried with a Scanner and it works just fine.