javascript
Brief description  about Online courses   join in Online courses
View Bikram Ballav  The Indian Student 's Profile

input /output help plz

IO/Console Output
Use an array of integers with size 10 and print the content of the array using write( ) method.

sir i have tried it many times but can't get exact result.My last try is
public class main {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub

for(int i=0;i<10; i )
{
System.out.write(i);
System.out.flush();
}
}
}

plzz help me how to solve this problem..i m baffled
Asked by Bikram Ballav The Indian Student | Apr 17, 2011 |  Reply now
Replies (1)
View arun kumar das 's Profile
Hi,

Use This code

public class WriteDemo {

public static void main(String args[]) {
int[] a = new int[10];
a[0] = '0';
a[1] = '1';
a[2] = '2';
a[3] = '3';
a[4] = '4';
a[5] = '5';
a[6] = '6';
a[7] = '7';
a[8] = '8';
a[9] = '9';
System.out.println("The Array Elements are:");
for(int i=0;i<10;i++) {
System.out.write(a[i]);
System.out.write('\n');
}

}

}

Java teacher
Apr 19, 2011