Java实现用到方法方法1int indexOf(int ch)返回指定字符在此字符串中第一次出现处的索引。方法2int lastIndexOf(int ch)返回指定字符在此字符串中最后一次出现处的索引。若二者一致,则该字符只有一个。 public class Solution { public int FirstNotRepeatingChar(String str) { if (str == "" || str == null) return -1; int temp = -1; for (int i =...