Skip to content

Commit bc639f2

Browse files
committed
GP-119 remove impl from main
1 parent cc79cae commit bc639f2

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

1-0-java-basics/1-3-1-crazy-generics/src/main/java/com/bobocode/basics/CrazyGenerics.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ public interface Converter { // todo: introduce type parameters
6565
*
6666
* @param <T> – value type
6767
*/
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;
7070

71-
public MaxHolder(T max) {
71+
public MaxHolder(Object max) {
7272
this.max = max;
7373
}
7474

@@ -77,13 +77,11 @@ public MaxHolder(T max) {
7777
*
7878
* @param val a new value
7979
*/
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
8482
}
8583

86-
public T getMax() {
84+
public Object getMax() {
8785
return max;
8886
}
8987
}

0 commit comments

Comments
 (0)