Java MCQ Question with Answer 02 Posted on June 11, 2020June 11, 2020 by admin 26 Created on June 11, 2020 By admin Java MCQ Question with Answer 02 1 / 10 Q. 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. 2 / 10 Q. Which one is a template for creating different objects ? A. An Array B. A class C. Interface D. Method 3 / 10 Q. Which symbol is used to contain the values of automatically initialized arrays? A. Brackets B. Braces C. Parentheses D. Comma 4 / 10 Q. 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 5 / 10 Q. Which of these operators is used to allocate memory to array variable in Java? A. alloc B. malloc C. new malloc D. new 6 / 10 Q. Which of these is not a bit wise operator? A. &' Operator B. &=' Operator C. |=' Operator D. <=' Operator 7 / 10 Q. Which statement transfer execution to different parts of your code based on the value of an expression? A. If B. Switch C. Nested-if D. if-else-if 8 / 10 Q. Which of these is returned by Greater Than, Less Than and Equal To (i.e Relational) operator ? A. Fload B. Integer C. Boolean D. Double 9 / 10 Q. Modulus operator (%) can be applied to which of these? A. Integers B. Floating - point numbers C. Both A and B D. None of These 10 / 10 Q. What feature of OOP has a super-class sub-class concept? A. Hierarchical inheritance B. Single inheritance C. Multiple inheritances D. Multilevel inheritance Your score is The average score is 24% LinkedIn Facebook Twitter 0% Restart quiz