IO/Console Output
IO/Console Output
Use an array of integers with size 10 and print the content of the array using write( ) method.
Note: Please do not use System.out.println( ) method.
SOLUTION:
import java.io.*;
public class ConsoleOutputAssignment {
public static void main(String args[]) {
int[] array = {2, 5, 7, 8, 4, 56, 76, 88, 98, 90};
for (int i = 0; i < array.length; i ){
System.out.write(array[i]);
System.out.println();
}
}
}
It has to be like this, but 2 problems there:
1) if I delete "System.out.println();" in line 10, program prints nothing,
2) anyway the program is not printing normal values, I think it is printing hashcode or something like that.
Please help me with this problem, thanks �