• Post Reply Bookmark Topic Watch Topic
  • New Topic

Distance  RSS feed

 
Kat Cobb
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't get this program to compile. The "DistanceTest" part doesn't match up with my "Distance" code. It tells me it 'can't find Distance' or it can't add the later portions. Any ideas?

This is my code:



Edit by mw: Added Code Tags. Please use these when posting code.
[ October 22, 2007: Message edited by: marc weber ]
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Kat Cobb:
I can't get this program to compile. The "DistanceTest" part doesn't match up with my "Distance" code. It tells me it 'can't find Distance' ...

If these files are in the same directory, then my guess is that you've set a CLASSPATH that does not include a dot (.) to indicate the current directory.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After taking a closer look...

The following line will not work because there is no Distance contructor that takes an instance of Distance.

So the error is actually "...cannot find symbol
symbol : constructor Distance(Distance)..."


There is a similar problem with the following line.

I'm not sure what your exact error messages are, so you still might have a classpath issue, but my guess is that fixing these 2 issues will solve the problem.
[ October 22, 2007: Message edited by: marc weber ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!