I have to know if Object is String or any other class type, how can I do it? Currently I do it like below, but its not very good coding.
Object
try {
Guard your cast with instanceof
instanceof
String myString; if (object instanceof String) { myString = (String) object; }