Hi,
This is one of the questions given in epracticelabs demo exam:
import java.util.*;
public class PayRoll
{
public static void main(
String argv[])
{
Vector<String>employeeList = new Vector<String>();
Vector<Integer>employeeIdList = new Vector<Integer>();
Vector<Object>employeeProfileList = new Vector<Object>();
System.out.println(employeeList.getClass()==employeeIdList.getClass());
System.out.println(employeeList.equals(employeeProfileList);
System.out.println(employeeList.getClass()==employeeProfileList.getClass());
System.out.println(employeeIdList.equals(employeeProfileList);
}
}
the answer gven is false false false true.
teh reason given that all instances of a generic class have the same runtime class so getClass() returns java.util.Vector.
In that case, the answer should have been true true true true.
Appreciate a clarification on this.
Thanks in advance.