Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. static <T> T makeNewInstance(Class<T> cls) {
  2. T t;
  3. try {
  4. t = cls.newInstance();
  5. return t;
  6. } catch (InstantiationException | IllegalAccessException e) {
  7. e.printStackTrace();
  8. return null;
  9. }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement