Skip to content

Instantly share code, notes, and snippets.

@aoirint
Created November 3, 2017 13:16
Show Gist options
  • Save aoirint/1da67e16ca628f45939f93ceed440bc0 to your computer and use it in GitHub Desktop.
Save aoirint/1da67e16ca628f45939f93ceed440bc0 to your computer and use it in GitHub Desktop.
public class Main {
public static void main(String[] args) {
Pair<Double, Integer> pair = new Pair<>(100d, 100);
}
static class Pair<L extends Number, R> {
private L left;
private R right;
public Pair(L left, R right) {
this.left = left;
this.right = right;
}
public L getLeft() {
return left;
}
public R getRight() {
return right;
}
}
}
@aoirint
Copy link
Author

aoirint commented Nov 3, 2017

int primitive
Integer object

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment