This is driving me insane!!!!! Why the hell does this output a square of hashes? The first for loop produces one hash five times, which are printed one by one and followed by a line termination each time. Meanwhile the second for loop does the same, so why isn't the output two vertical lines of five hashes? Someone please explain this to me before I kill myself!!!
public class HashSquare {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
{
for(int m=0 ; m<5 ; m++)
{
for(int n = 0; n<5 ; n++)
System.out.print ("#");
System.out.println("");
}
}
}
}
2007-10-12
06:22:45
·
6 answers
·
asked by
Anonymous
in
Computers & Internet
➔ Programming & Design