public static boolean isStop(String str){
  if (str.compareTo(".") == 0) {
    return true;
  }
  if (str.compareTo("?") == 0) {
    return true;
  }
  if (str.compareTo("!") == 0) {
    return true;
  }
  return false;
}

public static boolean isStop ( String str ) { if ( str . compareTo ( "." ) == 0 ) { return true ; } if ( str . compareTo ( "?" ) == 0 ) { return true ; } if ( str . compareTo ( "!" ) == 0 ) { return true ; } return false ; }
checks if is stop .
