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 the following are valid declarations for the main method. Select the three correct
answers.
A. public static void main(String args[]);
B. public static void main(String []args);
C. final static public void main (String args[]);
D. public static int main(String args[]);
E. public static abstract void main(String args[]);

2. Which of the following are true. Select the two correct answers.
A. A static method may be invoked before even a single instance of the class is
constructed.
B. A static method cannot access non-static methods of the class.
C. final modifier can appear before a class or a variable but not before a method.
D. A static method cannot access another static method directly

3. Which of the following are legal array declarations. Select the three correct answers.
A. int i[5][];
B. int i[][];
C. int []i[];
D. int i[5][5];
E. int[][] a;

4. Which of the following is a Java keyword. Select the four correct answers.
A. extern
B. synchronized
C. volatile
D. friend
E. friendly
F. transient
G. this
H. then

5. What all gets printed when the following program is compiled and run. Select the one correct
answer.
public class test {
public static void main(String args[]) {
int i=0, j=2;
do {
i=++i;
j--;
} while(j>0);
System.out.println(i);
}
}

A. 0
B. 1
C. 2
D. The program does not compile because of statement "i=++i;"
1. Ans : a,b,c
2. Ans : a,b
3. Ans : b, c, e
4. Ans : b, c, f, g

5. Ans : c

Das könnte Ihnen auch gefallen