How can check if we can cast an object to another?

Something like this :-

import java.util.ArrayList;

public class qu
{
    public static void main(String args[])
    {
        ArrayList<String> ar1=new ArrayList<String>();
        ArrayList<Character> obj = new ArrayList<Character>();
        if(obj instanceof java.util.ArrayList)
            System.out.println("My problem Solved");
    }
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)