Class X{
Integer x=new Integer(5);
Integer y;
public static void main (String[] args) throws java.lang.Exception
{
X i = new X();
String[] str={"x", "y"};
System.out.println(Integer.class.isInstance(str[0]));
}
}
It returns false as str[0] is a instance of Class String. Is there a way it can return true as str[0]=x and variable "x" is instance of Integer Class?
Thanks.