You are viewing a single comment's thread. Return to all comments →
Thanks. I didn't know I can pass objects to try block.
4th test case got failed tho, so I fixed it a lil bit.
public static void main(String args)
try(Scanner in = new Scanner(System.in))
} catch(InputMismatchException ex)