Sie sind auf Seite 1von 2

VIT UNIVERSITY

(ESTD. U/S 3 OF UGC ACT 1956)


SCHOOL OF INFORMATION TECHNOLOGY & ENGG
QUIZ I

Name : _________________________________ Reg No. ___________________

1. Which of these lines will compile? Select the four correct answers
A. short s=20;
B. byte b=128;
C. char c=32;
D. double d=1.4;
E. float f=1.4;
F. byte e=0;

2. A top level class may have only the following access modifier. Select the one correct
answer.
A. package
B. friendly
C. private
D. protected
E. public

3. Which of these statements are legal. Select the three correct answers.
A. int arr[][] = new int[5][5];
B. int []arr[] = new int[5][5];
C. int[][] arr = new int[5][5];
D. int[] arr = new int[5][];
E. int[] arr = new int[][5];

4. Which of the following are Java keywords. Select the four correct answers.
A. super
B. void
C. synchronize
D. instanceof

5. How can you ensure that the memory allocated by an object is freed. Select the one
correct answer.
A. By invoking the free method on the object.
B. By calling system.gc() method.
C. By setting all references to the object to new values (say null).
D. Garbage collection cannot be forced. The programmer cannot force the
JVM to free the memory used by an object.
1. Ans : 1,3,4,6
2. Ans : e
3. Ans : a,b,c
4. Ans : a,,b,d
5. Ans : d

Das könnte Ihnen auch gefallen