This week's book giveaways are in the iOS and Features new in Java 8 forums. We're giving away four copies each of Barcodes with iOS: Bringing together the digital and physical worlds and Core Java for the Impatient and have the authors on-line! See this thread and this one for details.
I keep getting a 'null value' in the allActivitiesLecturerLookupField[counter] memory locations instead of a lecturer's name. Why is this? All arrays have the correct information in them. What is wrong with my code?
[ February 07, 2006: Message edited by: Sam Bluesman ] [ February 07, 2006: Message edited by: Sam Bluesman ]
Have you tried using a debugger or output statements so that you can actually see how things are running? I'd assume that the if statement never evaluates to true, so you're left with the initial null values.
Joined: Nov 21, 2004
Yes it prints out null 5 times. But i dont understand why.
Unless the two objects point to the same reference in memory, the expression will always be false and hence, never assign the value. I am guessing you want to use the .equals() method instead of == to test whether the objects are equivalent (data-wise) rather than pointing to the same reference in memory.