Results 1 to 2 of 2

Thread: Objects to variables

  1. #1

    Thread Starter
    Addicted Member MethadoneBoy's Avatar
    Join Date
    Oct 2001
    Location
    Preferably somewhere between Keira Knightley and Diane Kruger but I'm not fussy
    Posts
    180

    Objects to variables

    Hi. Some of you may havve seen the connection between this and my last post.

    Basically the problem is I have to compare two int values passed in to a method.

    The code which my tutor gave me declares integers as objects

    Code:
    new Integer ( 12 );
    Does anyone know how I convert this to an int?
    "'Oh, hello Mr. Crick! What do you think of Jeffrey Archer?' Clip-clip-clip! Oh, come on! Who are you kidding? You wait til I'm mayor, you'll see how tough I am! Christ almighty...."

  2. #2
    Member hgroot's Avatar
    Join Date
    Dec 2001
    Location
    Amsterdam
    Posts
    52
    try Integer.intValue()

    and probably you could also say

    Integer1.equals(Integer2)

    to compare them

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