Re: [OT] "if" don't work?!?!?

2007-05-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chuck, Caldarale, Charles R wrote: >> From: Christopher Schultz [mailto:[EMAIL PROTECTED] >> Subject: Re: [OT] "if" don't work?!?!? >> >> String Pippo = "on"; >> >> if(Pippo == "on&q

RE: [OT] "if" don't work?!?!?

2007-05-22 Thread Caldarale, Charles R
> From: Christopher Schultz [mailto:[EMAIL PROTECTED] > Subject: Re: [OT] "if" don't work?!?!? > > String Pippo = "on"; > > if(Pippo == "on") >System.err.println("Pippo is on, man!"); Again, that's not what th

Re: [OT] "if" don't work?!?!?

2007-05-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chuck, Caldarale, Charles R wrote: >> From: Massimiliano PASQUALONI >> [mailto:[EMAIL PROTECTED] >> Subject: "if" don't work?!?!? >> >>if (Pippo == "on") { > > Guaranteed to be false. Not always: String Pippo = "on"; if(Pippo == "on") Sys

RE: [OT] "if" don't work?!?!?

2007-05-22 Thread Caldarale, Charles R
> From: Jost Richstein [mailto:[EMAIL PROTECTED] > Subject: Re: [OT] "if" don't work?!?!? > > No, that is not guaranteed to be false. > For example >Pippo.intern() == Pluto.intern() > should be true. The above certainly is correct, but is not

Re: [OT] "if" don't work?!?!?

2007-05-22 Thread Jost Richstein
No, that is not guaranteed to be false. For example Pippo.intern() == Pluto.intern() should be true. Caldarale, Charles R schrieb: From: Massimiliano PASQUALONI [mailto:[EMAIL PROTECTED] Subject: "if" don't work?!?!? if (Pippo == "on") { Guaranteed to be false. Pippo =

Re: OT: "if" don't work?!?!?

2007-05-22 Thread DJohnson
This is not really a Tomcat question, but a matter of Java language understanding. Comparators like ==, >, <=, etc. should only be used with java language primitive types, such as int, byte, boolean, and NOT with Objects, like String, as you are, UNLESS you actually wish to test whether the two

RE: [OT] "if" don't work?!?!?

2007-05-22 Thread Caldarale, Charles R
> From: Massimiliano PASQUALONI > [mailto:[EMAIL PROTECTED] > Subject: "if" don't work?!?!? > >if (Pippo == "on") { Guaranteed to be false. > Pippo = request.getParameter("abilitato"); > Pluto = request.getParameter("abilitato"); > > the if (Pippo == Pluto ) don't work! Also