the Customer.data(...) method is an instance method, so you would need to create a Customer first in order to call it. But since the purpose of the method is to generate customers to fill the array, having to make a Customer to do so doesn't make sense. In this case, since your data() method is what is called a 'factory method' (a method which makes objects),
you should make it static. Then you could call it from the Customer class like this:
I think you need some work on your variable names, though. For example,
x isn't very expressive, a better name might be
numberOfCustomers. Also, the variable
person is singular, but is an array - which typically holds multiple instances. It also doesn't really reflect the contents (which are instances of Customer, not instances of Person). So maybe a better name might be
customers which indicates both plurality and what it holds. Finally, the method
data() isn't expressive either, since it doesn't really indicate what action the method is doing. Perhaps
getCustomersFromInput() or something like that would be better. These are just ideas, of course. The purpose is that you can be pretty expressive with the names of variables and methods to make it more obvious what they are used for.