Need help with JAVA code
Hey! It's me again
I want to create the following pattern:
Using only this line of code:
So I need some loop codes to make this work. This is the code I got now:
That code makes it look like this:
What do I miss?
Hey! It's me again
I want to create the following pattern:
Code:
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
* * * * * * * *
Using only this line of code:
Code:
System.out.print(" ");
System.out.print("* ");
System.out.println();
So I need some loop codes to make this work. This is the code I got now:
Code:
public class stars {
public static void main(String[] args)
{
for (int i = 0; i < 4; ++i)
{
System.out.print("* ");
System.out.println();
for (int k = 0; k < 1; ++k)
{
System.out.print(" ");
System.out.print("* ");
System.out.println();
}
}
}
}
That code makes it look like this:
Code:
*
*
*
*
*
*
*
*
What do I miss?








