How to remove the first character of a string in Java. HelloGeeks-- If in beginning Output. Pin On Step Towards Coding While running my code I am getting a NumberFormatException. . Exception in thread main javalangNullPointerException at javalangStringsplitStringjava2324 at comStringExamplemainStringExamplejava11 2. This method always replaces malformed-input and unmappable-character sequences with this charsets default replacement string. After reading the line it. GeeksHello -- If at sat 3rd index Output. In the main method a new Scanner class object is initialized and a reference variable sc is set to represent the objectThis class is used to take user input in Java. Java program to check if a number is a happy number or not. Converting String to character array. NA at javalangNumberFormatExceptionforInputStringUnknown Source at java. Wrapper Class in Java. Create Set setDuplicateChars