Results 1 to 3 of 3
  1. #1
    junix is offline Member
    Join Date
    Dec 2007
    Posts
    1
    Rep Power
    0

    Default Programm Error: cannot find symbol Help?

    help me with this problem guyz..i am stuck, i am new to java, where going to program an something like array application. but it breaks my heart when i see this errors:
    Grade.java: cannot find this symbol
    symbol: method length()
    location: class double[]
    for(i=0; i<grades.length(); i++)
    ^

    //this is my code:
    i declared in my class
    private static double [] grades;
    then as i loop it
    for(i=0; i<grades.length(); i++)
    ^
    error goes out... pls help me guyz...
    God Bless

  2. #2
    Join Date
    Dec 2007
    Posts
    7
    Rep Power
    0

    Default Re:

    Could you please post your complete code so that we can be in a better position to see where your problem is.

    Since you are getting a "cannot find symbol error", it is possible that you are using a variable that has not been declared, or you have incorrectly implemented a method, or there is a spelling mistake in your syntax.

    HTH :)

  3. #3
    revathi17 is offline Member
    Join Date
    Aug 2007
    Posts
    26
    Rep Power
    0

    Default

    From what you have posted, you have used length() as a method like grades.length()
    but length is an attribute of the array, it is not a method
    you have to call it like this: grades.length

    Java Code:
    for (int i=0; i<grades.length; i++)
    {
    }
    Hope this helps..

    -R

Similar Threads

  1. [SOLVED] Java Error: Cannot find Symbol...
    By bobleny in forum New To Java
    Replies: 8
    Last Post: 04-15-2008, 07:35 AM
  2. cannot find symbol class error
    By po0oker in forum New To Java
    Replies: 5
    Last Post: 10-31-2007, 03:52 PM
  3. Error: cannot find symbol
    By silvia in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 06:39 AM
  4. Error: cannot find symbol
    By cachi in forum AWT / Swing
    Replies: 1
    Last Post: 08-06-2007, 09:12 PM
  5. Error: cannot find symbol constructor
    By zoe in forum New To Java
    Replies: 1
    Last Post: 07-24-2007, 09:24 PM

Posting Permissions

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