A simple problem that confounds me....

Hi everyone,

Im hoping this is a painfully simple mistake Im making, and not a profound one. My goal is to pring out a diamond display, and this is the code Ive written so far. If anyone can point out what might be wrong with it I would appreciate it.

publicclass DiamondDisplay

{

// begin main method

publicstaticvoid main ( String args[] );

{

System.out.println("*");

System.out.println("***");

System.out.println(" *****");

System.out.println(" *******");

System.out.println("*********");

System.out.println(" *******");

System.out.println(" *****");

System.out.println("***");

System.out.println("*");

}// end method

}// end class

When I compile this I get the following error....

DiamondDisplay.java:6 missing method body, or declare abstract

public static void "m"ain (String args[]);

1 error

Thanks in advance for any assistance.

[1567 byte] By [Housethemana] at [2007-11-26 22:28:38]
# 1
public static void main ( String args[] ); // <- remove that semicolon#
duckbilla at 2007-7-10 11:31:54 > top of Java-index,Java Essentials,New To Java...
# 2
You have a semicolon in a bad place : )
ignignokt84a at 2007-7-10 11:31:54 > top of Java-index,Java Essentials,New To Java...
# 3
You have an extra semi-colon after the method declaration.(edit) Oh so slow...
dcmintera at 2007-7-10 11:31:54 > top of Java-index,Java Essentials,New To Java...
# 4
LOLwell Im glad it was that simple and stupid, and not something I was completely missing... anyway, thanks a lot for the help, duke stars awarded :D
Housethemana at 2007-7-10 11:31:54 > top of Java-index,Java Essentials,New To Java...
# 5
After you fix the semicolon issue, let's talk about what you would do if your teacher wanted that diamond to be 9,999 asterisks wide instead of just 9. Would you plan on writing 9,999 lines of code to do that, or would you think about using a loop?
warnerjaa at 2007-7-10 11:31:54 > top of Java-index,Java Essentials,New To Java...
# 6
I would write a simple PERL script that would generate that tediously long .java file...
DrLaszloJamfa at 2007-7-10 11:31:54 > top of Java-index,Java Essentials,New To Java...
# 7

> After you fix the semicolon issue, let's talk about

> what you would do if your teacher wanted that diamond

> to be 9,999 asterisks wide instead of just 9. Would

> you plan on writing 9,999 lines of code to do that,

> or would you think about using a loop?

Actually my next question was going to be about a better way to write this program using a loop instead of just printing out this tedious program. What might be a good way to approach this?

Housethemana at 2007-7-10 11:31:54 > top of Java-index,Java Essentials,New To Java...
# 8
http://java.sun.com/docs/books/tutorial/java/nutsandbolts/for.htmlPrint single '*' and ' ' characters instead of whole Strings.Message was edited by: hunter9000
hunter9000a at 2007-7-10 11:31:54 > top of Java-index,Java Essentials,New To Java...
# 9
> I would write a simple PERL script that would> generate that tediously long .java file...what happens when the requested pattern is larger than the limit of a java file ?Split the printing up into seperate files ?
Aknibbsa at 2007-7-10 11:31:54 > top of Java-index,Java Essentials,New To Java...
# 10
btw, this is one of the most common class assignments.if you do a smart google search of these forums you'd findmany implementations (and at least one that ive done, lol).
TuringPesta at 2007-7-10 11:31:54 > top of Java-index,Java Essentials,New To Java...
# 11

http://forum.java.sun.com/thread.jspa?forumID=54&threadID=608677

http://forum.java.sun.com/thread.jspa?forumID=31&threadID=601070

http://forum.java.sun.com/thread.jspa?forumID=54&threadID=769053

http://forum.java.sun.com/thread.jspa?forumID=54&threadID=677802

http://forum.java.sun.com/thread.jspa?forumID=256&threadID=470214

and

http://forum.java.sun.com/thread.jspa?threadID=756174&start=15&tstart=0

TuringPesta at 2007-7-10 11:31:54 > top of Java-index,Java Essentials,New To Java...