1. Computing

Error Message: Cannot Find Symbol

By

Definition:

When a Java program is being compiled the compiler creates a list of all the identifiers in use. If it can't find what an identifier refers to (e.g., there is no declaration statement for a variable) it cannot complete the compilation. This is what the cannot find symbol error message is saying, it doesn't have enough information to piece together what the Java code wants to execute.

Possible Causes:

Examples:

The following code:


System.out.prontln("The perils of mistyping..");
will cause a cannot find symbol error because the System.out class does not have a method called “prontln”:


cannot find symbol
  symbol: method prontln(jav.lang.String)
  location: class java.io.printStream

The two lines below the message will explain exactly what part of the code is confusing the compiler.

Error Message Glossary:

# A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

  1. About.com
  2. Computing
  3. Java
  4. Java Syntax
  5. Java Error Messages
  6. C
  7. Definition for the Java Error Message: Cannot Find Symbol

©2014 About.com. All rights reserved.