Java Programming → Page 3
Java Programming solved MCQ sets : Java MCQ : Here you are going to get a selected list of
multiple choice questions (MCQ) on JAVA that will give you an idea of basic concept of object oriented
programming with Java language. These section include questions with answers on basic theory of Java to
test knowledge of fundamental concept of Java programming language. If you are ...READ MORE
TEST INSTRUCTION: CLICK OPTION (A, B, C, D) TO SEE ANSWER.
Q. | 1. What is garbage collection in the context of Java?A. Java deletes all unused java files on the system. B. Memory used by the object with no reference is automatically reclaimed. C. The JVM cleans output of Java program with error. D. Any unused package in a program automatically gets deleted. Show Answer |
Q. | 2. Which one is a template for creating different objects ?A. An Array B. A class C. Interface D. Method Show Answer |
Q. | 3. Which symbol is used to contain the values of automatically initialized arrays?A. Brackets B. Braces C. Parentheses D. Comma Show Answer |
Q. | 4. Which one is true about a constructor ?A. A constructor must have the same name as the class it is declared within. B. A constructor is used to create objects. C. A constructor may be declared private D. All of the above Show Answer |
Q. | 5. Which of these operators is used to allocate memory to array variable in Java?A. alloc B. malloc C. new malloc D. new Show Answer |