• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Have resolve symbol problems with a constructor. Please help.

 
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).]
 
Ranch Hand
Posts: 1067
2
IntelliJ IDE Spring Java
  • 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.
 
"The Hood"
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: 1067
2
IntelliJ IDE Spring Java
  • 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.
 
Sheriff
Posts: 9099
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Better?
 
William Barnes
Ranch Hand
Posts: 1067
2
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Way.
 
Good night. Drive safely. Here's a tiny ad for the road:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!