X469: Generics - Generic Method

Given a class Answer<E>, write a method allString that converts the argument e into String and returns that value. Remember, for primitive values, Java converts them into the corresponding object wrapper. For example, an int value would be passed as an object of type Object.

The partial definition of the class is below.

public class Answer<E> {
   public String allString(E e) { ... }
}

Your Answer:

Reset

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.