Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class TestBoxImpl {
- public static EqualityComparator<T> sameObject = new EqualityComparator<T>() {
- public boolean compare(T o1, T o2) {
- return o1 == o2;
- }
- }
- public static void main(String[] args) {
- Box<Number> nBox = new BoxImpl<Number>();
- Box<Integer> iBox = new BoxImpl<Integer>();
- //sebelumnya error menjadi OK
- nBox.put(iBox);
- boolean b = nBox.containsSame(iBox, sameObject);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment