Online Java Compiler By
JavaTpoint.com
import java.util.Scanner; public class JavaCharacterisIdentifierIgnorableExample5 { public static void main(String[] args) { // Ask the user for the first input. System.out.print("Enter the first input of your choice:"); // Use Scanner to get the input. Scanner obj1 = new Scanner(System.in); char[] value1 = obj1.nextLine().toCharArray(); // Get a value which indicates whether the given character is ignorable or not. for (char ch1 : value1) { boolean result1 = Character.isIdentifierIgnorable(ch1); System.out.println("The character '"+ ch1 +"' is an ignorable character : " + result1); } // Ask the user for the second input. System.out.print("Enter the second input of your choice:"); Scanner obj2 = new Scanner(System.in); char[] value2 = obj1.nextLine().toCharArray(); for (char ch2 : value2) { boolean result2 = Character.isIdentifierIgnorable(ch2); System.out.println("The character '"+ ch2 +"' is an ignorable character : " + result2); } } }
Output