Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MyThing<T> implements Comparable<T> {
- private int value;
- public MyThing(){
- }
- void setValue(int value){
- this.value = value;
- }
- int getValue(){
- return this.value;
- }
- @Override
- public int compareTo(T other) {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- if(this.value.compareTo(other.value) > 0){
- return 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement