• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

"Can't Find Symbol" error in Java

 
Ben Stevenson
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all. Still trying to figure this whole java thing out. I'm VERY new at this and it's pretty confusing to me. I keep getting the "cannot find symbol" error in the following code:

[Added code tags - see UseCodeTags for details]

My errors are:

Module5.java:12: error: cannot find symbol
SuperArray myNumbers = new SuperArray( unSortedNumbers );
^
symbol: class SuperArray
location: class Module5
Module5.java:12: error: cannot find symbol
SuperArray myNumbers = new SuperArray( unSortedNumbers );
^
symbol: class SuperArray
location: class Module5
2 errors


I've tried looking up how to fix this, read books and articles and still can't figure out what "symbol" the program is looking for me to put there.
THANK YOU for your help!!
 
Archana Nanjundarao
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ben,

Have you declared SuperArray class? Without class declaration you can't use it and I think thats the reason you are getting the error.

Thanks.
 
Matthew Brown
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Archana's right. The compiler doesn't know what SuperArray is. That error always means that you're using something - e.g. a class name or variable name - that the compiler doesn't know about for some reason.

By the way, I've added code tags and reformatted your code to make it much easier to read. See the page UseCodeTags for instructions on how to do that yourself.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic