Amtex Systems interview question

Java code to print each character in a string excluding white space