.net - Is there a Java equivalent of IConvertible/System.Convert? -


is there java equivalent, or java library with, type same thing system.convert in .net?

i want method takes object , whatever can convert integer, long, string, etc. can write own, prefer use 1 in library...

i'm not sure think no equivalent in java.

but can test solution :

public string convertstring(object oject1) {     if ( oject1 instanceof integer)     {           /// convert method           return stringconvert     }     if ( oject1 instanceof long)     {           /// convert method     }     ......   } 

Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -