16. Write Java applications as required. Write a main class called Test, with only one main method in the class;
A one-dimensional integer array of size 50 is defined in the main method, the array is named X, and the array holds {1,
3,5,..., 99} Outputs all elements of this array, each output 10 lines, and one in the Main method
A two-dimensional character array of size 10*10, with the array named Y, the positive and negative diagonal on the ' * ', the rest
The position is ' # '; outputs all elements of this array.
int [] x=new int[50];
Char [[] y=new char[10][10];
for (int i=0;i<50;i++)
{
x[i]=2*i+1;
if (i==10| | i==20| | i==30| | I==40)
{
System. out. println ();
}
System. out. Print ("" +x[i]);
}
System. out. println ();
for (int n=0;n<10;n++)
{
for (int z=0;z<10;z++)
{
if (z==n| | z== (9-n))
{
y[n][z]= ' * ';
}
Else
{
y[n][z]= ' # ';
}
}
}
System. out. println ();
for (char[] temp:y)
{
for (char temp1:temp)
{
System. out. Print (temp1+ "");
}
System. out. println ();
}
java-Array Exercise 4