V
V
Vitaly Vitrenko2015-07-16 20:17:13
Java
Vitaly Vitrenko, 2015-07-16 20:17:13

Warning: [rawtypes] found raw type: Comparable?

Greetings! In Algorithms in Java by Robert Sedgwick, the second chapter uses an ADT like this . The compiler constantly issues warnings about its use of Comparable as a data type. Here is one of the warnings

Selection.java:3: warning: [rawtypes] found raw type: Comparable
public static void sort(Comparable[] a) {
missing type arguments for generic class Comparable where T is a type-variable:
T extends Object declared in interface Comparable
.
Why is this warning being issued? And how to avoid it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question