public class SecondBig {
public static void main(String[] args) { int a[] = {9,8,7,7,8,8}; int firstB = a[0]; int secondB = a[1]; for(int i = 1; i<a.length; i++){ if(a[i] > firstB){ secondB = firstB; firstB = a[i]; } else if((a[i] < firstB)&&(a[i] > secondB)){ secondB = a[i]; } } if(firstB == secondB){ System.out.println("no secondB"); } else System.out.println("SecondB is " + secondB);
}
}