The following is not a full program, but sample codes.
// For loop & Array & If-else program
//Creating array of length 21
String[] array = new String[20];
// Code for filling array with number 0 - 20
for( int i = 0; i < array.length -1; i++ )
{
array[i] = i;
}
// If-else statement
if (array != null)
{
System.out.println("Array is not empty");
}
else
{
System.out.println("Array is empty");
}