Hello guys! I am trying to build app with this requirements:

We need a class Person with properties Name, Address and Gender, and with the ability to Save and Load all properties to/from local file system

I am having trouble to make method that will create new person object (for example Person p = new Person();), but each next object should be incremented p1,p2,p3... as long as there are entries.

Any ideas?

Recommended Answers

If you find yourself naming variables with incrementing numbers, use a list:

List<Person> peepls;
Jump to Post

All 2 Replies

If you find yourself naming variables with incrementing numbers, use a list:

List<Person> peepls;

OK, I will go that way. Thanks!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.