> Isn't it logical?
>
>    Integer xyz = new Integer(xyz.intValue() + 1);
> (Create a number that's One more than the number you are creating)
>
If xyz already exists, redeclaring "Integer xyz" is an error. If xyz has not
yet been declared, it can't be used as an rvalue.

In general, classes such as Integer, Double, etc. are so awkward that I
generally use them only when I need a descendant of Object for use in
Vectors, Hashtables, etc. I've you're determined to try and do math using
the integer class, however, you can do something like:

import java.lang.*;

class tt {
  public static void main(String[] args) throws Exception
    {
      Integer xyz = new Integer(0);

      for (int i=0; i<10; i++)
     {
       xyz = new Integer(xyz.intValue() + 1);
       System.out.println(xyz);
     }
      System.exit(0);
    }
}

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to