CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Java help!

  1. #1
    Join Date
    Aug 2009
    Posts
    52

    Java help!

    Hi i need help in debuging this error.. How can i pass the variable abbrName into this method? then append fullname into abbreviations[count-1].addFullName(fullname); then call back to constructor? or theres a better way of doing it?

    public int getAbbreviationCount(String strLine,int count){


    if(abbreviations[count-1].getAbbrName().trim().equals(abbrName.trim()))
    {
    abbreviations[count-1].addFullName(fullname);
    return count-1;
    }
    return count
    }




    Code:
    public class Abbreviation{
          private String abbrName, a;
          private String[] fullNames, b;
       
           public Abbreviation(String abbrName, String fullName ){
             this.abbrName=abbrName;
             String[] fullNames= { fullName };
             this.fullNames=fullNames;
          }
    Last edited by hugo84; October 29th, 2009 at 12:51 PM.

  2. #2
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,163

    Re: Java help!

    Quote Originally Posted by hugo84 View Post
    Hi i need help in debuging this error..
    What error? If you get an error, post the full error message text and stacktrace, if present.

    How can i pass the variable abbrName into this method? then append fullname into abbreviations[count-1].addFullName(fullname); then call back to constructor? or theres a better way of doing it?
    Perhaps if you described what your code is supposed to do, and explained what you were trying to achieve, it would make more sense...

    It is better to have an approximate answer to the right question than an exact answer to the wrong one...
    J. Tukey
    Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured