Web Design and Development MCQs with Answers
Practice important Web Design and Development MCQs with answers and explanations.
Multiple Choice Questions
Q81: What does the super keyword do in Java?
- A: Refers to the current instance
- B: Calls methods from the current class
- C: Refers to the superclass and calls its methods
- D: Creates new instance of superclass
View Answer
C
Q82: In Java garbage collection is done by_______________
- A: JVM (Java Virtual Machine)
- B: Programmer
- C: Both JVM (Java Virtual Machine)and Programmer
- D: OS (Operating System)
View Answer
A
Q83: How is an overridden method different from an overloaded method in Java?
- A: Overridden methods have the same name and parameters as in the superclass
- B: Overloaded methods have the same name but different parameters
- C: Overridden methods have different names from superclass methods
- D: Overloaded methods are defined in the same class only
View Answer
A
Q84: How do you create a new instance of a class in Java?
- A: Using new keyword
- B: Using create keyword
- C: Using instance keyword
- D: Using class keyword
View Answer
A
Q85: What is a key feature of Java Collections?
- A: Fixed size
- B: Dynamic size
- C: Limited types
- D: None of the above
View Answer
B
Q86: Which class in Java is a replacement for Vector?
- A: LinkedList
- B: HashMap
- C: ArrayList
- D: TreeSet
View Answer
C
Q87: What method is used to add an element to an ArrayList?
- A: insert()
- B: append()
- C: add()
- D: push()
View Answer
C
Q88: What does the size() method of a collection return?
- A: The first element
- B: The last element
- C: The number of elements
- D: The maximum capacity
View Answer
C
Q89: How do you retrieve an element at a specific index from an ArrayList?
- A: get()
- B: fetch()
- C: retrieve()
- D: access()
View Answer
A
Q90: What is the purpose of the contains(Object o) method in Java collections?
- A: To remove an object
- B: To check if an object is present
- C: To add an object
- D: To replace an object
View Answer
B