mcq practice oop
mcq practice oop
- a) &
- b) +
- c) *
- d) $
40. In Java, which access modifier makes a member accessible only within the
same package?
- a) private
- b) public
- c) protected
- d) default
44. What does the `static` keyword imply when applied to a method?
- a) The method belongs to an object
- b) The method belongs to the class
- c) The method cannot be overridden
- d) The method is private
58. What happens if a class implements an interface but does not provide
implementations for all methods?
- a) It throws a runtime error
- b) The class must be declared abstract
- c) It compiles successfully
- d) None of the above
87. Which class is used for reading text from a file in Java?
- a) FileReader
- b) FileInputStream
- c) BufferedReader
- d) Scanner
**END OF MCQs**