Mark
asked on
Having trouble instantiating class in java
I have the following class definition:
In my program I do the following:
class PurchaseData {
public BigDecimal purchaseYears,
contribRate,
milYears,
lapsedTime, lapsedTime2, lapsedTime3,
factor,
purchaseCost, purchaseCost2, purchaseCost3,
paymentAmount;
PurchaseData(BigDecimal py, BigDecimal cr, BigDecimal my,
BigDecimal l1, BigDecimal l2, BigDecimal l3,
BigDecimal f,
BigDecimal p1, BigDecimal p2, BigDecimal p3,
BigDecimal pa)
{
purchaseYears = py;
contribRate = cr;
milYears = my;
lapsedTime = l1;
lapsedTime2 = l2;
lapsedTime3 = l3;
factor = f;
purchaseCost = p1;
purchaseCost2 = p2;
purchaseCost3 = p3;
paymentAmount = pa;
}
}
Note that, all by itself, that class definition compiles w/o errors.In my program I do the following:
PurchaseData rd = new PurchaseData();
//and I've tried:
PurchaseData rd = new PurchaseData(null,null,null,null,null,null,null,null,null,null,null);
when I try to run, I get:org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 2,068 in the jsp file: /purchaseServiceCredit.jsp
The constructor purchaseServiceCredit_jsp.PurchaseData() is undefined
What am I doing wrong?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Np, Good luck.
ASKER