hi all i have to make a stars program in Java but i don't quite get the code yet .
i have some code and makes a star program but its the wrong way around.
Code:
public class Stars
{
public static void main(String[] args)
{
for (int row = 1; row <= 5; row++)
{
for (int space = 4; space <= row -5; space++)//this for loop is actually not doing anything,so better drop it off....
{
System.out.print(" ");
}
for (int star = 1; star <= 6 - row; star++)
{
System.out.print("*");
}
System.out.println();
}
}
}
My Results
G:\FPT>javac Stars.java
G:\FPT>java Stars
*****
****
***
**
*
pleas could somebody explain how i can change this around as i don't understand it explain what each line of code means so i could do this again
many thanks Andy..