-----Original Message-----
From: Yee, Hung
Sent: Wednesday, May 16, 2001 11:08 AM
To: 'James Childers'
Subject: RE: Problems with for loop (!)



The method 'valueOf(String)' for the 'Integer' class returns an 'Integer'
object, not the primitive data type 'int', so what you need to do is to
convert the Integer object to the equivalent int value.  You can do this by
replacing this:

  Integer.valueOf("minModStr");

with this:

  Integer.valueOf("minModStr").intValue();

Try this and see if this works for you.


-----Original Message-----
From: James Childers [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 16, 2001 10:24 AM
To: [EMAIL PROTECTED]
Subject: Problems with for loop (!)


Sometimes the simplest things cause the most problems...

The following code is giving me problems:

for (int t = Integer.valueOf("minModStr"); t <= 25; t++) {
            out.println("<h2>" + t + "</h2>");
        }

The error it returns is:

Error: The type of the left-hand side in this assignment, "int", is not
compatible with the type of the right-hand side expression,
"java/lang/Integer".

I have tried to declare t as Integer, but doing that gives

Error: The type of this expression, "Integer", is not numeric.

Hay-ulp.

- James

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
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
This email message is for the sole use of the intended recipient(s) and may
contain proprietary and confidential information. Any unauthorized review,
use, disclosure or distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message. Thank you

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
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