Will the following code compile?

public class GenericTest {
    public static void main(String[] args) {        
        List<double> myList = new ArrayList<double>(); 
Generic classes cannot be parameterised by primitive types.
Standard collections in Java allow to store only objects.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
Java quizzes
Sign Up Now
or Subscribe for future quizzes