Click here to Skip to main content
15,889,595 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi , I need java equivalent for Convert.ChangeType at c# ?

Can anybody help me ?
Posted

To the best of my knowledge, there is no direct equivilent to this.

Most (if not all) of the basic data types in java.lang provide static methods to safely convert, for example to convert a string to a number you can use:
int i = Integer.getInteger("546");


Read the API[^] for more details.

[ps don't answer your own questions, just amend the original.]
 
Share this answer
 
v2
If you want to convert String to Int in java use:
String str = "120";
int num = Integer.parseInt(str);
 
Share this answer
 
Hi,

The Convert.ChangeType is available in C#.

go through the folloing link.

http://msdn.microsoft.com/en-us/library/system.convert.changetype(VS.80).aspx

hope this helps

regards
kumaran
 
Share this answer
 
I think I ask incorect. I know there is at c# , but I wonder is there at java ?

Thanks
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900