Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Have resolve symbol problems with a constructor. Please help.

 
Chris Singer
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
William Barnes
Ranch Hand
Posts: 986
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
William Barnes
Ranch Hand
Posts: 986
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the edit Cindy, but now the post is too wide for my screen.
 
Marilyn de Queiroz
Sheriff
Posts: 9059
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Better?
 
William Barnes
Ranch Hand
Posts: 986
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Way.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic