Results 1 to 2 of 2
  1. #1
    jameshl2008 is offline Member
    Join Date
    Sep 2013
    Posts
    5
    Rep Power
    0

    Default The method(multiply) is undefined for this type(Big Int) java error?

    public BigInt multiplcationHelper(BigInt B1, BigInt B2) {

    int size1 = B1.num.size(), size2 = B2.num.size();// sizes of B1 and B2
    BigInt result = new BigInt();

    // result's num initial capacity of one more than B1's num and fill with null objects.
    result.num = new ArrayList (Collections.nCopies( size1+1, null ));
    //Both B1 and B2 are positive
    if (this.isPositive && B2.isPositive){
    for (int i = 0; i<size2; i++) {

    result = B1.add(B2);
    return result;
    }
    }


    public BigInt multiply(BigInt B2) {
    BigInt result = new BigInt();


    // Both B1 and B2 are positive.
    if (this.isPositive && B2.isPositive) {

    if (this.isBigger(B2)) {// "121345" > "123"
    result = multiplicationHelper(this, B2);
    } else { // B2 is bigger than B1 or equal to B2.
    result = multiplicationHelper(B1, this);
    }
    return result;
    }

    When I make a test class, it gives me this error (method(multiply) is undefined for the type (BigInt)) when testing this method. My test class looks like (all other syntax correct, just didnt put it in):

    Big Int B3;

    B3 = B1.multiply(B2);


    Thanks.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,812
    Rep Power
    25

    Default Re: The method(multiply) is undefined for this type(Big Int) java error?

    Please edit your post and wrap the code in code tags.
    Also copy the full text of the error message and paste it here.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Replies: 7
    Last Post: 03-29-2012, 10:26 AM
  2. Replies: 3
    Last Post: 11-18-2011, 09:15 AM
  3. Replies: 10
    Last Post: 12-07-2010, 01:29 PM
  4. Replies: 2
    Last Post: 05-08-2010, 12:02 AM
  5. Replies: 0
    Last Post: 05-27-2009, 05:39 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
  •