Number.class : Number « java.lang « Java by API






Number.class

public class DynamicTypeChecking {

  public static void main(final String[] args) {
    new Integer("0").getClass().isInstance(new Double("1.2").getClass());
    Number.class.isInstance(123);
    Number.class.isAssignableFrom(new Double("1.2").getClass());
  }
}

           
       








Related examples in the same category