This week's book giveaway is in the Programmer Certification forum. We're giving away four copies of OCP Oracle Certified Professional Java SE 21 Developer Study Guide: Exam 1Z0-830 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
I have just executed your code(adding the missing braces you forgot to put in the code tags here) and its running fine. I have given an input "abcd", its printing abcd and the program terminated.