文件名称:Java通过方法查找元素在数组中的位置(允许重复元素)
文件大小:1KB
文件格式:JAVA
更新时间:2021-02-07 19:09:43
数组,元素
String[] arr = new String[]{"a","b","c","d","e","eeee","f","g","a","h"}; Integer[] arr1 = new Integer[]{22,33,44,55,6,7,22,88,999}; searchOne(arr, "a"); searchOne(arr1, 33); 输出结果: a在被查询数组的下标为:0,8 33在被查询数组的下标为:1