Core Java| JSP| Servlets| XML| EJB| JEE5| Web Services| J2ME| Glossary| Questions? | Software Development
 

Java error cannot find symbol

The java error cannot find symbol occurred when a Compiler does not recognize a class name.

Java error cannot find symbol

                         

The java error cannot find symbol occurred when a Compiler does not recognize a class name. The following are the reason for such an error  -

1)When a programmer misspelled the name of the class.

2When a programmer do not Imported the class name.

In this Tutorial we want to describe you a code that help you in understanding java error cannot made symbol. For this we have a class name 'cannot find symbol'. Inside the main method we have initialized a int variable a and b with respective values and store the sum of the value in variable int d.The System.out.println. is used to print the output  in variable d in the try block. But in this code the programmer misspelled the variable.,inspite  of writing d,the programmer write variable e,The catch block helps you in handling the error occurred in the try block. Therefore  the compiler does not recognize a variable e show you an error Java error cannot find symbol.

Cannotfindsymbol.java
import java.lang.*;
public class Cannotfindsymbol {

    
    public static void main(String[] args) {
       try{
        int a=10;
       int b=3;
       
       int d=a+b;
       System.out.println(e);
    }
    catch(Exception ex){
        System.out.println(ex);
    }
    }
}

Output
/home/girish/NetBeansProjects/errors/src/
Cannotfindsymbol.java:
11: cannot find symbol

symbol  : variable e
location: class Cannotfindsymbol
            System.out.println(e);
error0

To remove this error you have to declare the variable e.

Download code

                         

» View all related tutorials
Related Tags: java windows c error orm form diff io dialog icons sed format version window display icon port using log support

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
 
Tell A Friend
Your Friend Name

 

 
Recently Viewed
Software Solutions
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.