Creating new object determining its type from a String
I have the type of a variable stored in a String, for example :
String s = "java.util.Date";
Now i need to create an object whose type is denoted by s. Is there a way to get this done ?
I tried using split on s to get the last String after '.' to check it with all primitive types and some basic advance types and then accordingly create an object however it seems that split will not work with '.'. I tried to use "\." but my code fails to compile. Please add your suggestions.