Computer Science Canada Very Weird, it will take you 10 secs to solve |
| Author: | Chinmay [ Sun Jan 06, 2008 7:54 pm ] | ||
| Post subject: | Very Weird, it will take you 10 secs to solve | ||
Why wouldnt this work?
Why wouldnt this code execute makeItemsList(); |
|||
| Author: | Tony [ Sun Jan 06, 2008 8:02 pm ] |
| Post subject: | RE:Very Weird, it will take you 10 secs to solve |
Because decision1 is a String object and "Y" is _another_ String literal. If they don't point to the same memory location, they are not the same, although they could hold the same value. To compare against values, you should use .equals() |
|
| Author: | Chinmay [ Sun Jan 06, 2008 8:38 pm ] |
| Post subject: | Re: Very Weird, it will take you 10 secs to solve |
oh yes i forgot, thx man very forgetfull |
|