TT - Java Core, Date: 2018-03-… Points Total: /
First and last name (block letters): …………………………… %: A
Signature …………………………… Score:
1. Which declaration of the main method below would allow a class to be started as a standalone
program.
A. public static int main(char args[]), B. public static void main(String args[])
C. public static void MAIN(String args[]), D. public static void main(String args)
2. What is the meaning of the return data type void?
A. An empty memory space is returned so that the developers can utilize it.
B. void is not supported in Java, C. void returns no data type, D. null
3. Which of these are legal identifiers.
A. number_1, B. numberA, C. $1234, D. All of the above.
4. Which of the following are Java keywords?
A. throw, B. void, C. private, D. All of the above.
5. In Java, a lower precision variable can be assigned to a higher precision value. For example, a
byte type can be assigned to an int type variable?
A. True, B. False
6. Which of these are not legal identifiers.
A. 1alpha, B. xy+abc, C. both A and B, D. None of the above
7. If you want your condition to depend upon two conditions both being true, what is the proper
notation to put between the two Boolean statements?
A. !, B. || , C. &&, D. $$
8. Which of the following statements about the Java language is true? Java supports:
A. procedureal and object oriented programming .
B. only procedural programming.
C. only OOP.
D. Java does not support either procedural or object-oriented programming.
9. Which of these are legal array declarations or definitions?
A. int[] x; B. int x[5]; C. int *x; D. None of above
10. Select the correct option for getting the number of elements in array
A. array.length, B. array.length - 1, C. array.size, D. array.length()
11. What is not a section of all types of loops ?
A. initialization, B. loop body C. test statement, D. the word while
12. Following code will result in: int num = 6.7
A. compilation error, B. rutime error C. num being 6.7, D. num being 6
13. Choose the appropriate data type for this field: isTeacher
A. double, B. boolean C. string, D. char