I am trying to understand how to indirectly access objects.
Using the following simple Customer Class. For example, here are two of 50 Customer objects. They are Bill and Bob.
public class Customer {
private int CustNum;
private String name;
private String homePhone;
Customer Bill = new Customer(100, “Bill West”,“1234567890”);
Customer Bob = new Customer(101, “Bob East”,“1234567891”);
I then wish to perform tasks on a certain object.
i.e. I want to work on object “Bob”
String custObj= “Bob”;
int dummynum = &custObj.CustNum;
I would like dummynum to contain the value 101.
You could even extend this to
String custObj= “Bob”;
String custField= “CustNum”;
int dummynum = &custObj.&custField;
The thought is to create dynamic flexible methods.