This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Checkerboard.java using a component Array and Counter-Controlled Loop Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Checkerboard.java using a component Array and Counter-Controlled Loop" Watch "Checkerboard.java using a component Array and Counter-Controlled Loop" New topic
Author

Checkerboard.java using a component Array and Counter-Controlled Loop

Joniela Geldenhuys
Greenhorn

Joined: Aug 24, 2011
Posts: 10



Helo I've just finished coding my one assignment. When I compile they give me an error.

java:88: ')' expected

When I put a ) in they just give me more errors!

Please help

Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17258
    
    6

This is the Spring forum for Spring Framework questions. I am going to move this to the Beginning Java forum.

I think the main issue is how your curly braces are lined up. I can't tell how things are lined up based on your indentation of code.

I copied your code into my ide and auto-indented and found


There is a semicolon after the curly brace, it should actually be after the curly brace just above it to end the addActionListener() call.

After those lines you have two methods which are not inside your class. The second curly brace I just showed is ending your class, then you have the two methods. You need to move those two methods to before that }//end Checkerboard frame to get the methods to be inside your class.

You always need to make sure curly braces are correctly lined up

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11443
    
  16

No offense, but you should never have gotten this far. Never, never never write more than 2-3 lines of code before you recompile. I have been know to recompile after writing a single line. Really you should recompile and TEST that often, but I do occasionally skip the testing part. but NEVER the compile.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39478
    
  28
== "Go"??

Never use == to test whether reference types are equal, except members of enums. And search our GUIs forum to find why addActionListener(this) is non-object-oriented design.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Checkerboard.java using a component Array and Counter-Controlled Loop