Skip to content

Instantly share code, notes, and snippets.

@beshkenadze
Created December 6, 2013 08:38
Show Gist options
  • Select an option

  • Save beshkenadze/7820499 to your computer and use it in GitHub Desktop.

Select an option

Save beshkenadze/7820499 to your computer and use it in GitHub Desktop.
private <T> T someMethod(Class<?> cls) {
Object o = new Object();
final T t = (T) cls.cast(o);
return t;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment