Random random = new Random();
for(int i = 0; i < 20; i++) {
System.out.print(random.nextInt(100));
if((i + 1) % 5 == 0) {
System.out.println();
} else {
System.out.print(",");
}
}
public class Test {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String str = "";
for(int i = 1 ;i < 21 ;i++){
str = str+" "+Math.round(Math.random()*100);
if(i % 5 == 0 ){
System.out.println(str);
str = "";
}
}
}
}