In simple... This program takes all number listed in array and first finds all numbers that can be divided by for evenly. Second it will take that array and sort the number in descending order
I am having trouble sorting the array in descending order.
When I use the Arrays.sort(dividend, Collections.reverseOrder());
Netbeans keeps saying "no subtitle method found".
import java.util.*;
//This program will take all numbers in the array and First, find all the
//numbers that are divisible by 4 and then sorts in descending order.
class ArrayFun
{
public static void main(String[] args)
{
//Declaring Variables
int[] dividend ={100,552,400,111,452,414,600,444,800};
//Starting While Loop with nested if statement
for(int i=0; i < dividend.length; i++)
{
//Nested if statement
if (dividend[i]%4 == 0)
{
System.out.println("This number '" +dividend [i]+ "' is divisble by 4.\n");
}
}
//Sorts Array from highest number to lowest
// This is the area that I am having programs.
Arrays.sort(dividend, Collections.reverseOrder());
}
}
Thanks for any help!