simple customer management system questions

have a main class called shop and another class called customer
only have one method on the customer called createCustomer
then you enter name,age,telephone

now...should i have the createCustomer method create an object of each customer (after its accumulated the details) and store it in a list?
is that how you would tackle this? would the createCustomer method return the object to main,or the list?

i havent got much done regarding what im asking,just need to see what direction it should go...am i on the right track?

In large systems, there would be a class or interface called CustomerRepository that is responsible for managing the collection of customers. The actual implementation should be transparent to all other classes, so they don't have to care whether the Customer objects are in a List in memory, or in a database, or in an XML file, or on little scrolls that little magic elves write on as they run around inside the computer.

im not ready to be using sql databases etc...just trying to get to grips with java language
it will only be a small program im trying to get right regarding instance variables,methods and encapsulation as well as returning values and passing arguments to methods

have a main class called shop and another class called customer
only have one method on the customer called createCustomer
then you enter name,age,telephone

now...should i have the createCustomer method create an object of each customer (after its accumulated the details) and store it in a list?
is that how you would tackle this? would the createCustomer method return the object to main,or the list?

i havent got much done regarding what im asking,just need to see what direction it should go...am i on the right track?

thanks for reading

If you have a class call Customer (notice the uppercase "C") you would create new objects with the code:

And if you want to set name, age, and telephone, probably the best way would be:

If you were creating a List of Customers, you would probably do something like this: