What will be the output of the following code?
import java.util.*;
public class Test {
public static void main(String[] args) {
Set<String> set = new HashSet<>();
set.add("Java");
set.add("Python");
set.add("Java");
System.out.println(set);
}
}
[Java, Python, Java]
[Java, Python]
[Python, Java, Java]
Compilation Error
This question is part of this quiz :
Java Set and HashSet Classes