Link to home
Start Free TrialLog in
Avatar of Mark
Mark

asked on

Having trouble instantiating class in java

I have the following class definition:
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;
    }
} 

Open in new window

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);

Open in new window

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

Open in new window

What am I doing wrong?
ASKER CERTIFIED SOLUTION
Avatar of Radek Baranowski
Radek Baranowski
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mark
Mark

ASKER

Thanks! That did the trick.
Np, Good luck.