fork(3) download
  1. import java.util.*;
  2. import java.lang.*;
  3.  
  4. class Main
  5. {
  6. public static void main(String[] args) throws java.lang.Exception
  7. {
  8. String a = "zappaz";
  9. String b = "not";
  10.  
  11. System.out.println(containsDouble(a, 'z'));
  12. System.out.println(containsDouble(b, 'z'));
  13. }
  14.  
  15. private static Boolean containsDouble(String s, char letter) {
  16. return s.indexOf(letter, s.indexOf(letter) + 1) > -1;
  17. }
  18. }
Success #stdin #stdout 0.06s 215488KB
stdin
Standard input is empty
stdout
true
false