fork(1) download
  1. public class Main {
  2.  
  3. public Main(){
  4. System.out.println(hasNumbers("StackOverflow"));
  5. System.out.println(hasNumbers("5t4ck0verfl0w"));
  6. }
  7.  
  8. public boolean hasNumbers(final String string){
  9. String numbers = "0123456789";
  10. for(char a : string.toCharArray())
  11. for(char b : numbers.toCharArray())
  12. if(a == b)
  13. return true;
  14. return false;
  15. }
  16.  
  17. public static void main(String[] args) {
  18. new Main();
  19. }
  20. }
Success #stdin #stdout 0.07s 380160KB
stdin
Standard input is empty
stdout
false
true