How do I display the following?

Hey guys,

I know there's a for loop involved in this, but how do I display the following output?

*

**

***

****

*****

******

*******

********

********

**********

In case you have a hard time counting the stars, it's from 1-10 respectively.Any help would be appreciated. Thanks.

[357 byte] By [asian_cajun_2000a] at [2007-10-2 18:16:59]
# 1
Simply have a loop that will append an additional "*" to a string every time it runs. Throw a print statement in the loop and you're set.
vex001@gmail.coma at 2007-7-13 19:37:13 > top of Java-index,Java Essentials,Java Programming...
# 2

Here you go:

public class test {

public static void main(String args[]) {

int i = 0;

StringBuffer buf = new StringBuffer("");

while (i < 10) {

buf.insert(0, "*");

String star = buf.toString();

System.out.println(star);

i++;

}

}

}

vex001@gmail.coma at 2007-7-13 19:37:13 > top of Java-index,Java Essentials,Java Programming...
# 3
Thanks, now what if I wanted the reverse version of that same output?
asian_cajun_2000a at 2007-7-13 19:37:13 > top of Java-index,Java Essentials,Java Programming...
# 4
StringBuffer has a method to delete a char. Read the API to find it.
CeciNEstPasUnProgrammeura at 2007-7-13 19:37:13 > top of Java-index,Java Essentials,Java Programming...
# 5
What does that have to do with the question I'm asking?
asian_cajun_2000a at 2007-7-13 19:37:13 > top of Java-index,Java Essentials,Java Programming...
# 6
Everything. Don't expect everything to be handed to you on a silver platter. I showed you how to append, you can just as easily search Google for the opposite.
vex001@gmail.coma at 2007-7-13 19:37:13 > top of Java-index,Java Essentials,Java Programming...
# 7
> What does that have to do with the question I'm> asking?It clearly shows that if people give you code, you get your homework done, but only to fail at the next task, because you don't bother to understand what the code does.
CeciNEstPasUnProgrammeura at 2007-7-13 19:37:13 > top of Java-index,Java Essentials,Java Programming...