indexOf()当没有值时。反回-1;

解决方案 »

  1.   

    CORE JAVA,初学必读........现在有第6版本了。
      

  2.   

    thinking in java 
    必读!!!!
      

  3.   

    数组的长度是8的时候想得到index=8以上的,就会出这样的问题。
      

  4.   

    private char getChar(String strTemp, int i) {

    char chTemp = 0;

    try {
    chTemp = strTemp.charAt(i);

    } catch(IndexOutOfBoundsException e) {
    e.printStackTrace();
    }
    return chTemp;
    }
      

  5.   

    Thinking in Java 不适合初学者,专家级的书