Forums Register Login

Array and condition problem

+Pie Number of slices to send: Send
I have an array which contains the names of days read from a line in a test file which contains other information, such as time etc.

For example,

com1402, Dr Andy Gordon, Monday, 0900

(The purpose being to record when a lectuer is to take place)

The code is written below


I KNOW that lecDayArray[0] holds the string "Monday". However, the above returns the word "No", although it should return "Yes". What is wrong with my code?
[ February 26, 2006: Message edited by: Sam Bluesman ]
+Pie Number of slices to send: Send
Use lecDayArray[0].equals("Monday") instead of lecDayArray[0] == "Monday"
+Pie Number of slices to send: Send
Cheers for that!
Think of how stupid the average person is. And how half of them are stupider than that. But who reads this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 743 times.
Similar Threads
synchronize method call
Java help.
code segment question #2
Declaring a PrintWriter object
object array?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 06:25:27.