Tag: programming languages

Questions Related to programming languages

  1. It must have a package statement

  2. It must be named Test.java

  3. It must import java.lang

  4. It must declare a public class named Test


Correct Option: B
  1. Collections.reverseSort(list, new MyComparator());

  2. Collections.sort(list, new MyComparator());

  3. Collections.sort(list, new InverseComparator(

  4. Collections.sort(list, Collections.reverseOrder(


Correct Option: D
  1. The type List is assignable to List.

  2. The type List is assignable to List>.

  3. The type List is assignable to List extends B>.

  4. The type List extends B> is assignable to List extends A>.

  5. The type List is assignable to any List reference.


Correct Option: B,C,D