Skip to content

Instantly share code, notes, and snippets.

@kemsakurai
Created January 19, 2017 14:18
Show Gist options
  • Save kemsakurai/6e2cace634e9c356764337f3c7971cf2 to your computer and use it in GitHub Desktop.
Save kemsakurai/6e2cace634e9c356764337f3c7971cf2 to your computer and use it in GitHub Desktop.
classがデフォルトコンストラクターを保持するかBooleanで返す
public boolean isExistsDefalutConstructor(Class<?> clazz) {
try {
clazz.getConstructor(null);
return true;
} catch (NoSuchMethodException e) {
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment