Strings are not compared using == in Java!!!!!!!!
Use String.equals("another string")as Jeniffer pointed out

----- Original Message -----
From: Jennifer Buffington <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 07, 2000 3:12 PM
Subject: Re: Problem with if statement


> This is a java problem...
> try
>
> if (key.equals("AT") {
> ... do something...
> }
>
> Look up the difference between == and equals.
>
> -----Original Message-----
> From: Aaron Prohaska [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 07, 2000 11:40 AM
> To: [EMAIL PROTECTED]
> Subject: Problem with if statement
>
>
> I am trying to do something based on if key is equal to "AT", but I am not
> getting any results. It acts as if key is not equal to "AT", but I can use
> out.println(key) get "AT". Does anyone know why this might not be working?
>
> if (key == "AT") {
> ..do something...
> }
>
> thanks,
>
> Aaron
>
>                 <<:::..:::...::: Aaron Prohaska :::..:::...:::>>
> VerdeSoft Internet Services
> mailto:[EMAIL PROTECTED]          http://www.verdesoft.net/
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to