package com.test;
public class FindType {
public static void main(String[] args) {
System.out.println(findTypeOfObject("10"));
System.out.println(findTypeOfObject(10));
System.out.println(findTypeOfObject(10.00));
}
private static String findTypeOfObject(Object object){
String type = null;
if (object != null ) {
type = object.getClass().getName();
}
return type;
}
}
public class FindType {
public static void main(String[] args) {
System.out.println(findTypeOfObject("10"));
System.out.println(findTypeOfObject(10));
System.out.println(findTypeOfObject(10.00));
}
private static String findTypeOfObject(Object object){
String type = null;
if (object != null ) {
type = object.getClass().getName();
}
return type;
}
}