Android examples for java.lang.reflect:Class
is Class Primitive Type
//package com.java2s; public class Main { public static boolean isPrimitiveType(Class<?> type) { if (type.isPrimitive()) { return true; }/*from w w w . j av a 2 s . co m*/ if (type == Boolean.class) { return true; } if (type == Character.class) { return true; } if (type == Byte.class) { return true; } if (type == Short.class) { return true; } if (type == Integer.class) { return true; } if (type == Long.class) { return true; } if (type == Float.class) { return true; } return type == Double.class; } }