public class ShoeMakers{
Customer[] cust = new Customer[2];
/*[SIZE="3"]Necessary constructor and method calls[/SIZE],
*[SIZE="3"]cust[0..x] are initialised with values[/SIZE]
*[SIZE="3"]Here we can make calls like:[/SIZE]
*id = cust[i].getID;*/
}
public class Customers extends ShoeMakers{
private int id;
String name;
Customer(int i, String nam){
id = i;
name = nam;
}
/*[SIZE="3"]Necessary accessor and mutator methods e.g. getID and changeID;*/
/*Im thinking since the cust[0.. x] has valid data, and Customer
*inherets the data members from ShoeMaker, can i access the fields
*id and name through cust[x].getWhatever from this class?[/SIZE] */
}
If the answer to that question is no. Can I access the fields of cust with:cust[0..x].getWhatever
from a class with a slightly different relationship to Customer, say,
public class Collect extends ShoeMakers{
}
without transfering the cust array to the collect class?


Sign In
Create Account


Back to top









