Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Poop {
- public static void main(String[] args) {
- System.out.println(findCommonAncestor(1, 2L, 3.0, ""));
- }
- public static <A> String findCommonAncestor(A... in) {
- // Get encapsulated Class name.
- String name = in.getClass().getSimpleName();
- // Clean up array.
- return name.substring(0, name.length() - 2);
- }
- }
- // Output: Comparable
Advertisement