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

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.