to start off...
http://java.sun.com/I'm taking a comp sci class this year and we learn Java... so i had the good idea to post a forum for discussion about java, where we could post codes we might be having trouble with, and just a general discussion of the language.
I'm going to start off by talking about how much I hate it when you accidentally create an infinite loop.
also... I was wondering if someone could help me with this code... what i have so far is as follows:
// ********************************************************************
// Stars.java Author: achtung
//
// Prints diamond shape using asterisk (star) characters.
// ********************************************************************
public class Stars5
{
public static void main (String[] args)
{
final int MAX_ROWS = 10;
for (int row = 1; row <= MAX_ROWS/2; row++){
for (int star = 1; star <= (MAX_ROWS/2) - row; star++)
System.out.print (" ");
for (int row2 = 1; row2 <= (row*2) -1; row2++)
System.out.print ("*");
System.out.println();
}
for (int row = 1; row <= (MAX_ROWS/2); row++){
for (int star = 1; star<= row -1; star++)
System.out.print (" ");
for (int row2 = 1; row2 <= MAX_ROWS - (row*2) + 1; row2++)
System.out.print ("*");
System.out.println();
}
}
}
the output should read:
*
***
*****
*******
*********
*******
*****
***
*
but i seem to be getting it to look like this... and i want to know why!

*
***
*****
*******
*********
*********
*******
*****
***
*
can someone help me out?