Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String to Object

Status
Not open for further replies.

Nicky

Programmer
Nov 28, 2000
9
0
0
US
i have a function
insertAtRank(int rank, Object element)

String a = textField1.getText();

what i wanna do is:

insertAtRank(1, a)// but a is a String, i wanna pass it as an Object. anybody know?
Thanx
 
Every primitive can be wrapped to make an object:

aObj = new String(a);

I think this should work ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top