Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Nov 28th, 2007, 12:55 PM   #1
kruptof
Professional Programmer
 
kruptof's Avatar
 
Join Date: May 2006
Location: UK - London
Posts: 330
Rep Power: 3 kruptof is on a distinguished road
Thumbs up Object to Int

I am doing one of my Java assignments and I need to pass a method an int but I am receiving the data as an Object, is it possible to convert an Object to an int.

I will just demonstrate what I mean because I can't post my actual code.
public void A(Object o)
{
      //call B with the given data
      //do something
}
public void B(int i)
{
      //do something
}
__________________
Quote:
When I was young it seemed that life was so wonderful,a miracle, oh it was beautiful, magical.
Now watch what you say or they'll be calling you a radical,a liberal, oh fanatical, criminal. Oh won't you sign up your name,we'd like to feel you're acceptable, respectable, oh presentable, a vegetable
kruptof is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Casting signed int to unsigned int? null_ptr0 C++ 1 Nov 23rd, 2007 9:27 PM
Object reference error Jabo Visual Basic .NET 3 Oct 5th, 2007 2:37 AM
Library problem creating Direct3d Object Kilo C++ 9 May 30th, 2006 8:48 AM
Pushin an object into a vector slyadams C++ 18 Mar 30th, 2006 11:17 AM
references passed through parameters, do they copy the object or reference the orig? cypherkronis Python 1 Jun 30th, 2005 7:38 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:03 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC