ANSWERS: 1
  • import java.io.IOException; import java.util.Scanner; public class letternum { public static void main(String[] Args) { char input='\0'; try { input = (char) System.in.read(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } if(Character.isDigit(input)) { System.out.println("we have a digit"); } else { System.out.println("we have a non-digit"); } } }

Copyright 2020, Wired Ivy, LLC

Answerbag | Terms of Service | Privacy Policy