[2600] in java-interest

home help back first fref pref prev next nref lref last post

Cause of error...

daemon@ATHENA.MIT.EDU (George E Crawford)
Thu Oct 5 20:06:50 1995

From: George E Crawford <gec2@Ra.MsState.Edu>
Date: Thu, 5 Oct 1995 16:57:10 -0500
To: java-interest@java.sun.com

I'm having trouble executing the following chunk of code:
    Stock stock1 = new Stock( "CompanyA", 2, (double)30.00 );
    Stock stock2 = new Stock( "CompanyB", 3, (double)20.00 );
The compiler complains with the following:
StockTest.java:5: No constructor matching Stock(java.lang.String, int, double) found in class STOCK_PACKAGE.Stock.
        Stock stock1 = new Stock( "CompanyA", 2, (double)30.00 );
                       ^
StockTest.java:6: No constructor matching Stock(java.lang.String, int, double) found in class STOCK_PACKAGE.Stock.
        Stock stock2 = new Stock( "CompanyB", 3, (double)20.00 ); 
                       ^
2 errors
The method for the Stock constructor looks like:
    public void Stock( String newCompany, int numberOfShares, double price ) {
        // initialization of variables
    }

Any ideas?

Thanks,
George Crawford III
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post