On Mon, 20 Sep 2004 04:21:30 +0000, timothy ma and constance lee wrote:
I think out the way to generate blank space with length:
for(int i=1; i<length; i++){
" "+=" ";
}
to generate " "
But it look like very dirty. Is there any better idea?
The problem is that different characters have different widths. For
simple output, use tabs (\t), eg
public class testtab{
public testtab(){
}
public void output(){
System.out.print("a");
System.out.print('\t');
System.out.println("b"); //done in bits
System.out.println("abc"+ '\t' + "def"); //or all together now
System.out.println("abcdefg"+'\t'+"qwerty");
}
public static void main(String args[]){
testtab t = new testtab();
t.output();
}
}
Tony