Results 1 to 4 of 4
  1. #1
    javastuden's Avatar
    javastuden is offline Senior Member
    Join Date
    Nov 2009
    Posts
    162
    Rep Power
    6

    Default int count=ss.lenght(); error

    class Count{
    public static void main(String ar[])
    {
    String ss=ar[0];
    int count=ss.lenght();
    System.out.println("count"+ss.length()+count);
    //System.out.println("count"+ss.length());}}
    if this is the pgm then
    error
    Count.java:8: cannot find symbol
    symbol : method lenght()
    location: class java.lang.String
    int count=ss.lenght();
    ^
    1 error

    if i commnet the "int count=ss.lenght();" and next line and uncomment then it will give out put no error why this?????????

  2. #2
    CodesAway's Avatar
    CodesAway is offline Senior Member
    Join Date
    Sep 2009
    Location
    Texas
    Posts
    238
    Rep Power
    6

    Default

    It's a typo.

    Java Code:
    int count=ss.leng[COLOR="Red"]ht[/COLOR]();

    should be

    Java Code:
    int count=ss.leng[COLOR="#ff0000"]th[/COLOR]();
    CodesAway - codesaway.info
    writing tools that make writing code a little easier

  3. #3
    ocean is offline Senior Member
    Join Date
    Sep 2009
    Location
    Sweden/Borås
    Posts
    107
    Rep Power
    0

    Default

    Morning.

    What are your
    Java Code:
    String ss=ar[0];
    int count=ss.lenght();
    System.out.println("count"+ss.length()+count);
    Meant to do ?

  4. #4
    javastuden's Avatar
    javastuden is offline Senior Member
    Join Date
    Nov 2009
    Posts
    162
    Rep Power
    6

    Default spelling length();

    thanks for your replays

    actually the error was lenght(); spelling length();

Similar Threads

  1. Line Count
    By tim in forum NetBeans
    Replies: 1
    Last Post: 08-02-2009, 05:41 PM
  2. Making a count..
    By Samgetsmoney in forum New To Java
    Replies: 15
    Last Post: 02-18-2009, 02:44 PM
  3. Select Count
    By Apple2 in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 04-29-2008, 10:02 AM
  4. Getting row count
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 02-11-2008, 09:49 AM
  5. how to count 2 inserts together?
    By kim85 in forum New To Java
    Replies: 0
    Last Post: 01-20-2008, 12:25 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
  •