logo

Crowdly

Browser

Add to Chrome

Java 1 (012026-ANP)

Looking for Java 1 (012026-ANP) test answers and solutions? Browse our comprehensive collection of verified answers for Java 1 (012026-ANP) at lms2.apiit.edu.my.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

Find the output:

import java.util.*;

public class Main {

    public static void main(String[] args) {

        List<String> list = Arrays.asList("A", "B");

        List<?> obj = list;

        System.out.println(obj.get(1));

    }

}

View this question

Find the output

import java.util.*;

public class Main {

public static void main(String[] args) {

List<Double> list = new ArrayList<>();

list.add(4.4);

List<? extends Number> obj = list;

System.out.println(obj.get(0).getClass().getSimpleName());

}

}

 

100%
0%
0%
View this question

Find the output:

import java.util.*;

public class Main {

    public static void main(String[] args) {

        List<Double> list = Arrays.asList(1.5, 2.5, 3.5);

        List<? extends Number> obj = list;

        Number n = obj.get(2);

        System.out.println(n);

    }

}

0%
0%
100%
0%
View this question

Find the output:

import java.util.*;

public class Main {

    public static void main(String[] args) {

        List<Integer> list = new ArrayList<>();

        List<? extends Number> obj = list;

        obj.add(100);

        System.out.println(obj);

    }

}

0%
0%
100%
0%
View this question

What can you add to List<?>?

0%
0%
43%
57%
View this question

Which wildcard is used to read data safely?

0%
100%
0%
0%
View this question

Which wrapper class should be used instead of int in generics?

0%
0%
100%
0%
View this question

Which one is true about generics and primitive types?

100%
0%
0%
0%
View this question

Which declaration allows only Number or its subclasses?

0%
0%
100%
0%
View this question

What does extends mean in bounded generics?

86%
14%
0%
0%
View this question

Want instant access to all verified answers on lms2.apiit.edu.my?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome