Tuesday, 7 February 2017

Reflection : isInterface, isArray,





class Country{}
interface My{}

class Test{
    public static void main(String args[]){
        try{
            Class c=Class.forName("Reflection.Country");
            System.out.println(c.isInterface());

            Class c2=Class.forName("Reflection.My");
            System.out.println(c2.isInterface());

        }catch(Exception e){System.out.println(e);}

    }
}

No comments:

Post a Comment