Results 1 to 5 of 5

Thread: int!=Integer

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Apr 2001
    Posts
    843

    int!=Integer

    So... how can make an int that can take the value of an Integer?

    it is funky that you cant do something like this:

    int a;
    Integer b=new Integer("0");
    a=b; //error go to ****


    "The difference between mad and genius is the success"

  2. #2
    Code:
    If (a == b.intValue())

  3. #3
    Or
    Code:
    a = b.intValue();

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Apr 2001
    Posts
    843
    ohhh... thank you
    "The difference between mad and genius is the success"

  5. #5
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    Yeah you definitely wouldn't be allowed to compare a refrence type to a primative type. You would have to get the Integers value through the intValue(); method that filburt pointed out.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width