This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Erroneous sym type What does this mean? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Erroneous sym type What does this mean?" Watch "Erroneous sym type What does this mean?" New topic
Author

Erroneous sym type What does this mean?

Lynn Marciniak
Greenhorn

Joined: Sep 04, 2011
Posts: 7

I have been working on this for days now, and can't figure out what I am doing wrong. I have to use the following for my method I am trying to call from main public static void sort(double num1, double num2, double num3)


If I take out the method that I have to include, it runs just fine, so I know that I have issues with the way I am handling the method.

[Edit: added code tabs - MB]
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11153
    
  16

when you CALL a method, you don't have to give it the parameter types. Change line 19 to this:



There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Jian Shen
Greenhorn

Joined: Dec 02, 2010
Posts: 3
Hi,

The code looks fine except the sort method call:


You need to declare variable type only when define a method. So the calling code should be:
Lynn Marciniak
Greenhorn

Joined: Sep 04, 2011
Posts: 7

Thank you! I can't believe it was so simple!
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11153
    
  16

it's always simple if you know what it is...

Just mark this off as one more thing you've learned, and (hopefully) won't make again. I can't begin to tell you how long my list of mistakes like this I've made is.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Erroneous sym type What does this mean?
 
Similar Threads
Need help with Overloading Methods
Problem with Sort Method
Integer Object Comparision Confusion
Triangle Perimeter HELP!!!
[HOMEWORK] Please need help with java project