一种企业的 Java 面试题 给定一种 int 数组,写一种函数判断该数组中的所有数字与否能构成持续数字。如[1,3,4,6,2,5]能构成持续数字,【1,2,5,4,7】不能。数组中的数也也许反复呵呵,我采用笨措施:先用一种循环找出数字中的最大值和最小值,然后从最小到最大值在数组中循环查找对应数字,只要有一种数没有找到,就返回 false,假如都找到了,就返回 true. public boolean isContinousArr ...public boolean isContinousArray(int[] intArr) { 1. if(intArr==null) return false; 2. if(intArr.length<2) return true; 3. int maxInt=intArr[0],minInt=intArr[0]; 4. for(int i:intArr) 5. { 6. System.out.println(i); 7. if(i>maxInt) maxInt=i; 8. if(i