Tony Gormley

Greenhorn
+ Follow
since Oct 28, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Tony Gormley

damn messed up the last bit of code
here its again

and the error
java.lang.ArrayIndexOutOfBoundsException
at personList.getPersonAt(personList.java:77)
at Person2.main(Person2.java:54)
Exception in thread "main"
Thanks :roll:
20 years ago
Hi,
thanks for the reply, can I just say to begin with, if this was a homewrok assignment I would be honest enough to say so, beleive it or not I actually want to learn how to do this. Sorry about the code tags didnt realise about that, so heres the code


Here is the error exactly as it appears,
java.lang.ArrayIndexOutOfBoundsException
at personList.getPersonAt(personList.java:77)
at Person2.main(Person2.java:54)
Exception in thread "main"
If i can get a handle on how to this I should be able to work with Arrays a bit better than just now. And apologies if I have messed up again, I appreciate the patience of your good selves with programming novice!
Cheers.
[ edited to fix formatting -ds ]
[ October 31, 2003: Message edited by: Dirk Schreckmann ]
20 years ago
Hi,
its the first time I have posted here. I am just starting with JAVA and really need some help with a small prgram I have writtem I was messing about so the progrm will probably look a bit dtrange and pointless but the whole point was really just to create an Array, populate it with data and search succesfully on one of the variables. The problem is at the very bottom, I just cant figure out where i am going wrong.
Here is the code

The text file
32 Glasgow 12
George Stephenson
44 Edinburgh 15
Robert McMeachan
21 London 20
John Smith
22 Rochdale 21
Richard Evans
23 Lisbon 23
Frank White
24 Lisboa 250
Gerry McNee
25 Azoia 33
Randall Hopkins
28 Cascais 45
Telly Savallas
56 Estoril 50
Randy Hopkins
============================================================================
And finally the error message!
java.lang.NullPointerException
at Person2.main(Person2.java:59)
Exception in thread "main"
============================================================================
I know I am doing something wrong but cant figure exactly what, any help would be greatly appreciated!
Thanks in advance.

[ edited to format code -ds ]
[ October 31, 2003: Message edited by: Dirk Schreckmann ]
20 years ago