fork(1) download
  1. class Main {
  2. public static void main (String[] args) {
  3. String x = "1234";
  4. System.out.println(x.charAt(0) >= '0' && x.charAt(0) <= '9');
  5. x = "a123";
  6. System.out.println(x.charAt(0) >= '0' && x.charAt(0) <= '9');
  7. }
  8. }
  9.  
  10. //https://pt.stackoverflow.com/q/111739/101
Success #stdin #stdout 0.06s 32296KB
stdin
Standard input is empty
stdout
true
false