nerdexam
Oracle

1Z0-851 · Question #250

A programmer must create a generic class MinMax and the type parameter of MinMax must implement Comparable. Which implementation of MinMax will compile?

The correct answer is A. class MinMax<E extends Comparable<E>> {. See the full explanation below for the reasoning.

Question

A programmer must create a generic class MinMax and the type parameter of MinMax must implement Comparable. Which implementation of MinMax will compile?

Options

  • Aclass MinMax<E extends Comparable<E>> {
  • Bclass MinMax<E implements Comparable<E>> {
  • Cclass MinMax<E extends Comparable<E>> {
  • Dclass MinMax<E

How the community answered

(20 responses)
  • A
    80% (16)
  • B
    10% (2)
  • C
    5% (1)
  • D
    5% (1)

Community Discussion

No community discussion yet for this question.

Full 1Z0-851 Practice