File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
1-0-java-basics/1-3-1-crazy-generics/src/main/java/com/bobocode/basics Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -65,10 +65,10 @@ public interface Converter { // todo: introduce type parameters
65
65
*
66
66
* @param <T> – value type
67
67
*/
68
- public static class MaxHolder < T extends Comparable < T >> { // todo: refactor class to make it generic
69
- private T max ;
68
+ public static class MaxHolder { // todo: refactor class to make it generic
69
+ private Object max ;
70
70
71
- public MaxHolder (T max ) {
71
+ public MaxHolder (Object max ) {
72
72
this .max = max ;
73
73
}
74
74
@@ -77,13 +77,11 @@ public MaxHolder(T max) {
77
77
*
78
78
* @param val a new value
79
79
*/
80
- public void put (T val ) {
81
- if (val .compareTo (max ) > 0 ) {
82
- max = val ;
83
- }
80
+ public void put (Object val ) {
81
+ throw new ExerciseNotCompletedException (); // todo: update parameter and implement the method
84
82
}
85
83
86
- public T getMax () {
84
+ public Object getMax () {
87
85
return max ;
88
86
}
89
87
}
You can’t perform that action at this time.
0 commit comments