Results 1 to 4 of 4

Thread: Error - count=ss.lenght()

  1. #1
    Join Date
    Jul 2009
    Posts
    188

    Error - count=ss.lenght()

    Hi
    This is my code, please check it. When i am trying to run the code I am getting an error. Please help. This is a part on my program
    Code:
    clastr Count{
    public static void main(String args[])
    {
    String str=args[0];
    int count=str.lenght();
    System.out.println("count"+str.length()+count);
    //System.out.println("count"+str.length());}}
    Then the error I get is
    error
    Count.java:8: cannot find symbol
    symbol : method lenght()
    location: clastr java.lang.String
    int count=str.lenght();

  2. #2
    Join Date
    Oct 2005
    Posts
    2,393

    Re: Error - count=ss.lenght()

    Hi
    This is a typing mistake. Correct it and the program will run
    The statement you have is
    Code:
    int count=str.lenght();
    If should be
    Code:
    int count=str.length();
    Please try to avoid spelling mistakes. Be careful.

  3. #3
    Join Date
    Feb 2008
    Posts
    1,852

    Re: Error - count=ss.lenght()

    Hi
    For what purpose are you using the following code.
    Code:
    String str=ar[0];
    int count=str.lenght();
    System.out.println("count"+str.length()+count);
    When you mention a program and the problem and try to mention that what is the aim of the program or where will the program be heading to. So that it is a ease to give answers.

  4. #4
    Join Date
    Jul 2009
    Posts
    188

    Re: Error - count=ss.lenght()

    Hi
    As you said I changed the following
    int count=str.lenght();
    to
    int count=str.length();
    Yes, it worked, thanks and in future I will try to avoid such mistakes. And also for further posting I will mention the aim of the program.

Similar Threads

  1. Replies: 6
    Last Post: 25-02-2011, 10:40 AM
  2. Redirect Count down
    By puk284 in forum Software Development
    Replies: 1
    Last Post: 28-10-2010, 03:30 AM
  3. What is Regexp count
    By GunFighter in forum Software Development
    Replies: 3
    Last Post: 06-08-2009, 02:21 PM
  4. Reallocated Sector Count error in Seagate 500GB HDD
    By jade in forum Hardware Peripherals
    Replies: 3
    Last Post: 01-06-2009, 10:25 PM
  5. How can I get the row count from DataGrid?
    By Shashikant in forum Software Development
    Replies: 4
    Last Post: 04-02-2009, 11:47 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,710,829,031.21138 seconds with 16 queries