Forum : Not Getting Proper output
Brief description  about Online courses   join in Online courses
View Anusha  D R 's Profile

Not Getting Proper output

import java.io.*;


class WriteArray {
public static void main(String args[]) {
int w[] = {1,2,3,4,5,6,7,8,9,10};
for(int i=0;i<10;i ){
System.out.write(w[i]);
System.out.write('\n');
}
}
}

for this program i am not getting any errors or any exceptions...i am not getting proper output for this it showing some symbols
Asked by Anusha D R | Sep 30, 2010 |  Reply now
Replies (1)
View arun kumar das 's Profile
write method is best used to print characters and not integers. Please replace the write method with println and you should be able to see the output more clearly.
Oct 1, 2010