Core Java-Sample-2
Core Java-Sample-2
Core Java-Sample-2
14.If you are inserting any value in the wrong index as shown below,
1. int a[]=new int[5];
2. a[10]=50;
a) NullPointerException
b) ArrayIndexOutOfBoundsException
c) ArithmeticException
d) NumberFormatException
17. Which of these field declarations are legal within the body of an
interface?
a) aprivate final static int answer = 42
b) public static int answer=42
c) final static answer =42
d) dint answer
29.Which of these method of Thread class is used to find out the priority
given to a thread?
a) get()
b) ThreadPriority()
c) getPriority()
d) getThreadPriority()
40. To compare whether two references point to the same object we use
a) both a and B.
b) .equals function
c) == operator
d) compareTo