Results 1 to 4 of 4
  1. #1
    surendra0607 is offline Member
    Join Date
    Feb 2012
    Posts
    3
    Rep Power
    0

    Default Error: Cannot find symbol

    Hi,

    I am running these 3 programs from the same package

    PROG1:
    package objectconcepts;

    public class Formatter {
    public void formatmessage(){
    System.out.println("The

    message is formatted");


    }
    }


    PROG2:
    package Objectconcepts;

    public class Messenger{

    public void sendmessage() {
    Formatter f = new Formatter();
    f.formatmessage();

    System.out.println("The message formatted is

    sent to the leagacy system");
    }

    }

    PROG 3:

    package objectconcepts;

    public class MessengerTest {

    public static void main(String args[]){

    Messenger m1 = new Messenger();
    m1.sendmessage();

    }

    }



    when i compile all the programs "javac objectconcepts\*.java " im getting the following error:

    C:\JAVATUTORIAL\Chapter4>javac objectconcepts\Messenger.java
    objectconcepts\Messenger.java:6: error: cannot find symbol
    Formatter f = new Formatter();
    ^
    symbol: class Formatter
    location: class Messenger
    objectconcepts\Messenger.java:6: error: cannot find symbol
    Formatter f = new Formatter();
    ^
    symbol: class Formatter
    location: class Messenger
    2 errors

    PLEASE HELP !!!

    Error: Cannot find symbol-err.png
    Last edited by surendra0607; 02-05-2012 at 07:05 AM.

  2. #2
    surendra0607 is offline Member
    Join Date
    Feb 2012
    Posts
    3
    Rep Power
    0

    Default Re: Error: Cannot find symbol

    Moreover, Im using notepad and am saving all these 3 programs in different notepad and saving in the objectconcepts folder. Is there anything wrong in this??

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,419
    Rep Power
    20

    Default Re: Error: Cannot find symbol

    Yup, the folder name has to match the package name. Java is case sensitive.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    surendra0607 is offline Member
    Join Date
    Feb 2012
    Posts
    3
    Rep Power
    0

Similar Threads

  1. Cannot Find Symbol error
    By mrgreenacid in forum New To Java
    Replies: 13
    Last Post: 05-16-2011, 07:28 AM
  2. Error: Cannot Find Symbol
    By mawright in forum New To Java
    Replies: 4
    Last Post: 04-14-2011, 02:41 PM
  3. Please help- Error: cannot find symbol
    By Avthar in forum New To Java
    Replies: 4
    Last Post: 02-28-2011, 07:34 AM
  4. Replies: 9
    Last Post: 10-18-2008, 08:26 PM
  5. Error: cannot find symbol
    By silvia in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 05:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •