- A Yes, both overloading and overriding are possible for static methods in Java.
- B No, static methods cannot be overloaded or overridden in Java.
- C Overloading is possible but overriding is not allowed for static methods in Java.
- D Overriding is possible but overloading is not allowed for static methods in Java.
- Share this MCQ
Answer:
A
Share this MCQ
Static methods in Java can be overloaded or overridden. Overloading is the process of having two or more methods with the same name but different parameters, while overriding is the process of having two methods with the same name and same parameters. Overloading is possible for static methods in Java, as it does not depend on the object instance. On the other hand, overriding is also possible for static methods in Java, as it is based on the type of the object instance.
Click me to Read more Question & Answer of Java Interviews MCQsShare this MCQ