Have resolve symbol problems with a constructor. Please help.
Chris Singer
Greenhorn
Joined: Nov 27, 2001
Posts: 15
posted
0
Help. I'm getting the following error when I try compiling a very simple program. And I'm getting the following error: <pre> [root@Linux voice-mail]# javac -classpath .:/usr/java/j2sdk1.4.0/: /usr/java/j2sdk1.4.0/lib/: /usr/java/j2sdk1.4.0/jre/lib/ VoiceMail.java VoiceMail.java:29: cannot resolve symbol symbol : constructor HexArray (int[],int) location: class HexArray hexCommand = new HexArray(cmd, length); ^ 1 error </pre> (Note the carrot is under the n in new) I have the Class HexArray in a seperate file in the same directory as VoiceMail.java and there is a constructor that takes an int array and an int as parameters. I'll include the code just in case I have made some boneheaded mistake. Here goes:
I believe my problem is an environmental problem but I have no clue as to what it could be. I have tried all many of class path settings to no avail. I'm running this on a Linux box with JDK 1.4.0 if that is of any use. Thank you all for taking the time to read this. Chris (edited by Cindy to format code) [This message has been edited by Cindy Glass (edited November 27, 2001).]
(edited by Marilyn to shorten dashed lines and commented lines) [This message has been edited by Marilyn deQueiroz (edited November 28, 2001).]
When I tried to paste this code into my editor the first problem I noticed was this:
Since I don't know what you want this 'for' loop to look like I can't do much else. Post back when you fix the code up. Please use the code tags to make your post more read-able. Thanks.
Please ignore post, I have no idea what I am talking about.
Cindy Glass
"The Hood"
Sheriff
Joined: Sep 29, 2000
Posts: 8521
posted
0
Constructors do not have a return type. Putting the "void" in the signature converted them from a constructor to just a regular method that you never called.
"JavaRanch, where the deer and the Certified play" - David O'Meara