public static boolean isPrimitive(String type){
  if (type.equals("int") || type.equals("long") || type.equals("double")|| type.equals("float")|| type.equals("char")|| type.equals("boolean")|| type.equals("byte")) {
    return true;
  }
  return false;
}

public static boolean isPrimitive ( String type ) { if ( type . equals ( "int" ) || type . equals ( "long" ) || type . equals ( "double" ) || type . equals ( "float" ) || type . equals ( "char" ) || type . equals ( "boolean" ) || type . equals ( "byte" ) ) { return true ; } return false ; }
this method judges whether the type is a primitive type .
