fork(1) download
  1.  
  2. class Ideone {
  3. public static void main (String[] args) {
  4. String x = "1234";
  5. System.out.println(x.charAt(0) >= '0' && x.charAt(0) <= '9');
  6. x = "a123";
  7. System.out.println(x.charAt(0) >= '0' && x.charAt(0) <= '9');
  8. }
  9. }
Success #stdin #stdout 0.1s 320576KB
stdin
Standard input is empty
stdout
true
false