Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-31-2007, 05:58 AM
Member
 
Join Date: Jul 2007
Posts: 40
baltimore is on a distinguished road
Error: ')' expected
Hi, I'm writing a Java application. The program utilizes methods in classes separate from the main class. When I try to run it, I get an error. This is the error:
Code:
"Error: ')' expected."
The code that it points to is the place where I call the methods from inside a switch() statement. It cites 4 different examples but they are all the same, just different method names. Here is just one of the ones that it finds the error with:
Code:
imaginary.addition(int a1,int b1,int a2,int b2);
In the imaginary class, I implement the addition method like follows:

Code:
public void addition(int a1,int b1,int a2,int b2)
I can't understand what the error is asking for. Everything seems fine to me. Could someone please help me out with what it wants? If you need the whole code just let me know and I will readily post it.
Thanks.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-07-2007, 08:32 AM
Member
 
Join Date: Jul 2007
Posts: 40
mathias is on a distinguished road
Try:
Code:
imaginary.addition(a1,b1,a2,b2);
or
Code:
imaginary.addition((int)a1,(int)b1,(int)a2,(int)b2);
if you want to cast them as ints.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Identifier expected error vasu18 New To Java 1 01-01-2008 07:49 PM
Error: <identifier> expected barney AWT / Swing 2 07-31-2007 09:38 AM
Error: '{' expected romina New To Java 1 07-26-2007 11:34 AM
My error is: ')' expected silvia New To Java 1 07-18-2007 06:49 PM
MSG ERROR: : expected Marty New To Java 1 05-31-2007 04:21 AM


All times are GMT +3. The time now is 09:31 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org