I am not getting the right output for this....this program it is suppose to search all the persons class and if there is a match of password and username output the results.
What output are you getting ? My guess would be an IndexOutOfBoundsException. Arrays are indexed from 0 to length -1. Your for loops are looping from 0 to length. Changetoand see if that helps.
I've used persons.length instead of 10, as this will allow you to change the size of your persons array without having to worry about changing the for loop.
PLEASE STOP POSTING NEW THREADS each time you have a new question. It gets very hard for people to follow where you are, what you're stuck on, what advice you've been given...
I'm going to close all the others. We'll make THIS one your offical thread. All follow ups should go here.
Thanks
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors