7. แถวลำดับ

The Camtasia Studio video content presented here requires JavaScript to be enabled and the latest version of the Macromedia Flash Player. If you are you using a browser with JavaScript disabled please enable it now. Otherwise, please update your version of the free Flash Player by downloading here.

 
รหัสที่ 7-10  เมท็อดค้นข้อมูลในอาเรย์
  public static int search(String[] s, String x) {  
    for (int i=0; i<s.length; i++) {
      if (s[i].equals(x)) return i;
    }
    return -1;
  }
©2009 S.Prasitjutrakul