Re: java beginnings



On Sat, 29 Sep 2007 11:20:04 -0700, cusickgeorge@xxxxxxxxxxx wrote,
quoted or indirectly quoted someone who said :

public class Cat
{
private int[] carId;
private int[] makerId;


/**
* Creates a new instance of Cat
*/
public Cat(int[] anCarId, int[] aMakerId)
{

}

I think you are asking how does the Cat constructor record for
posterity the values of the parameters.

public Cat(int[] anCarId, int[] aMakerId)
{
this.carId = anCarId,
this.makerId = aMakerId;
}

Usually you name your parm and instance variable
the same like this:

public class Cat
{
private int[] carId;
private int[] makerId;

public Cat(int[] carId , int[] makerId )
{
this.carId = carId ,
this.makerId = makerId ;
}
}
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
.