Assuming that what you are trying to do is find the largest and smallest integers are in an array of integers:
public static void main (String args[]) {
Scanner input = new Scanner(System.in);
System.out.println("Type 10 numbers");
//I will create the array here...
int[] nums = new int[10];
//assigning numbers/ints
for(int i = 0; i < 10; i++) {
nums[i] = input.nextInt();
}
//now to find the largest and smallest (in this order)
int largest = 0;
for(int j = 0; j < nums.length; j++)//usage of the 1-line rule :)
if(nums[j] > largest)
largest = nums[j];
int smallest = largest;
//I'm doing this, so that it keeps checking for something lower than the largest number...
for(int k = 0; k < nums.length; k++)//usage of the 1-line rule again :)
if(nums[k] < smallest)
smallest = nums[k];
System.out.println("Largest: " + largest);
System.out.println("Smallest: " + smallest);
}
Hope this helps!