CJCoding With Joseph
15free / daySign inCreate account
Back to Multiple Choice Quiz

Select topics to narrow your question pool, then enable Random to jump to a random question matching your filters.

Topics

Generic Method Type Inference

Java quiz · Question 35
mediumGenerics, Methods

What does this code print?

Code

1public class Main {
2 public static <T> void printTwice(T value) {
3 System.out.println(value);
4 System.out.println(value);
5 }
6 
7 public static void main(String[] args) {
8 printTwice("Java");
9 }
10}