Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing string literals to constructor 1

Status
Not open for further replies.

utahjzz98

Programmer
Jan 9, 2003
69
US
I have a class with a constructor that accepts 5 args including 3 String data types. When I attempt to create a new object of that class and pass the constructor the String data types I receive the following error: "illegal start of type". I'm not sure what I am missing, any help would be appreciated.

Code:
Delivery(String yr, String mth, String delnum, int distcd, double wt)
{
        year = yr;
	month = mth;
	distanceCode = distcd;
	packageWeight = wt;
	monthlyDelNum = delnum;
	deliveryNumber = year + month + monthlyDelNum;
}

public class DeliveryExample
{
	Delivery delivery("9", "07", "123", 1, 3.5);
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top