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.
And the output is :
Name: Bhreac BLACK Age: 34
Name: Moibeal WALLACE Age: 7
Name: Morogh GORDON Age: 80
Name: Boyd JOHNSTON Age: 16
Name: Crissy FERGUSON Age: 27
Name: Daileass ANDERSON Age: 45
============
the min age is
Exception in
thread "main" java.lang.NullPointerException
at Collection.minAge(Collection.java:44)
at Collection.main(Collection.java:58)
any suggestions why my method for the min Age is wrong (think) ?