I have this code in my main()
public static void main(String[] args) {
// TODO Auto-generated method stub
Customer forrest = new Customer("Forrest Gump", 1, "42 New Street, New York, NY");
Customer random = new Customer("Random Name", 2, "44 New Street, New York, NY");
...
}
how can i proceed to writing code so it returns an instance of the customers given an id number (say 1 given returns forrest, 2 given returns random)
Use static fields or if it may throw an exception write static block in your class. Please never start variable name from capital letter.
If you want to return class