Results 1 to 2 of 2
- 09-27-2013, 01:08 AM #1
Member
- Join Date
- Sep 2013
- Posts
- 5
- Rep Power
- 0
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.
- 09-27-2013, 02:09 AM #2
Similar Threads
-
The method setName(String) is undefined for the type Person
By Astralogic in forum EclipseReplies: 7Last Post: 03-29-2012, 10:26 AM -
The method setVisable(boolean) is undefined for the type ChooseColor
By fishy8158 in forum New To JavaReplies: 3Last Post: 11-18-2011, 09:15 AM -
Error: "The method startsWith(String, String) is undefined for the type StringUtils"
By shihad_s in forum New To JavaReplies: 10Last Post: 12-07-2010, 01:29 PM -
The method myFunction(String) is undefined for the type
By jfill in forum New To JavaReplies: 2Last Post: 05-08-2010, 12:02 AM -
[SOLVED] [newbie] The method GBC(int, int) is undefined for the type FontFrame
By jon80 in forum New To JavaReplies: 0Last Post: 05-27-2009, 05:39 PM
Bookmarks