minAge from a txt file

Hello everyone ! I will be very glad if you can help me with the solution for my problem. My program reads from a txt file. After it opens the file I should write a method for the person with the min age from the file.

First, let me point you to this wiki page: UseCodeTags (<- click). They make your code much easier to read (as you can see, I took the liberty of adding the tags for you).

Your problem is that you have an ArrayList<Person> named people that you try to use on line 44. The people ArrayList is never initialized to an actual List. You have a method which is supposed to do it but you never call that method. You need to make sure that list is created before you try to use it.

Later on you will get into trouble because you never actually put anything into the list, so even though you read the Person objects from the file, and when you make the ArrayList, the Person objects won't be in the list. You need to add them to the list in your readFromFile method so you can access them later on.