Unstoppable Domains

[Resolved] Need help with JAVA code

Spaceship Spaceship
Watch

zk0

Established Member
Impact
3
Need help with JAVA code

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?
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Answered on webmasters-meet.com .

Nick
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99
Appraise.net

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Live Options
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back