public class Main {
public Main(){
System.
out.
println(hasNumbers
("StackOverflow")); System.
out.
println(hasNumbers
("5t4ck0verfl0w")); }
public boolean hasNumbers
(final String string
){ String numbers
= "0123456789"; for(char a : string.toCharArray())
for(char b : numbers.toCharArray())
if(a == b)
return true;
return false;
}
public static void main
(String[] args
) { new Main();
}
}
cHVibGljIGNsYXNzIE1haW4gewogICAgCiAgICBwdWJsaWMgTWFpbigpewogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbihoYXNOdW1iZXJzKCJTdGFja092ZXJmbG93IikpOwogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbihoYXNOdW1iZXJzKCI1dDRjazB2ZXJmbDB3IikpOwogICAgfQogICAgCiAgICBwdWJsaWMgYm9vbGVhbiBoYXNOdW1iZXJzKGZpbmFsIFN0cmluZyBzdHJpbmcpewogICAgICAgIFN0cmluZyBudW1iZXJzID0gIjAxMjM0NTY3ODkiOwogICAgICAgIGZvcihjaGFyIGEgOiBzdHJpbmcudG9DaGFyQXJyYXkoKSkKICAgICAgICAgICAgZm9yKGNoYXIgYiA6IG51bWJlcnMudG9DaGFyQXJyYXkoKSkKICAgICAgICAgICAgICAgIGlmKGEgPT0gYikKICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICByZXR1cm4gZmFsc2U7CiAgICB9CiAgICAKICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZ1tdIGFyZ3MpIHsKICAgICAgICBuZXcgTWFpbigpOwogICAgfQp9