Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-11-2008, 02:27 PM
Member
 
Join Date: Jan 2008
Posts: 83
Preethi is on a distinguished road
Converting object to string
How to convert an arrayObject into String Object?

Thank you..
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 02-11-2008, 04:38 PM
hey hey is offline
Member
 
Join Date: Dec 2007
Posts: 21
hey is on a distinguished road
what do you mean by arrayObject?

probably this will work ?

string = (String) arrayObject;
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 02-12-2008, 03:06 AM
Member
 
Join Date: Jan 2008
Posts: 20
JAdmin is on a distinguished road
You mean an object in an Array?
If so, as hey pointed out, cast the value to String. (Note: All values in Array and other collection classes are stored as objects. So when you retrieve them you need to cast them back to their original type)

Hope this helps
__________________
Sincerely, Your friends at
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 02-15-2008, 06:13 AM
Member
 
Join Date: Feb 2008
Posts: 3
mars_red is on a distinguished road
thank you for the help i am still trying to work on it .
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 06-14-2008, 05:29 AM
Member
 
Join Date: Jun 2008
Posts: 22
ferranb is on a distinguished road
Hope this helps

Object[] object_array = {xxx, xxx};
String[] string_array = new String[object_array.length];
for (int i = 0 ; i < object_array.length ; i++)
string_array[i] = object_array[i].toString();
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Object from String (calling method dynamically) Java Tip Java Tips 0 02-16-2008 11:22 PM
Object from String Java Tip Java Tips 0 02-16-2008 11:20 PM
Converting String to Double srini New To Java 1 12-24-2007 10:03 PM
Converting Epoch to string Date amyedwards New To Java 3 12-15-2007 12:33 AM
String vs Object Gilgamesh New To Java 1 11-29-2007 12:26 AM


All times are GMT +3. The time now is 07:55 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org