I've just started my first java class few days ago and have been given a homework. I was ask to write a program in java to display this:
Here is my codes:
I want to know is my codes correct or is there any other way to do this?
w w w w w w
w w w w w w w w
w w w w w w w w
w w w w w w w w
w w w w
Here is my codes:
public class WW {
public static void main(String[] args) {
System.out.println("W W W W W W");
System.out.println(" W W W W W W W W");
System.out.println(" W W W W W W W W");
System.out.println(" W W W W W W W W");
System.out.println(" W W W W");
}
}
I want to know is my codes correct or is there any other way to do this?