Java MCQ: What is an interface in Java?
a) A class that cannot be instantiated
b) A blueprint for classes
c) A type of abstract class
d) A final class
Answer:
b) A blueprint for classes
Explanation:
An interface in Java is a blueprint for classes. It defines methods that the implementing classes must provide, allowing for a form of multiple inheritance and promoting loose coupling between components.
Understanding interfaces is crucial for designing flexible and scalable Java applications.
Reference links:
https://www.rameshfadatare.com/learn-java-programming/
https://www.javaguides.net/p/java-tutorial-learn-java-programming.html