Java MCQ: What is an interface in Java?
a) A blueprint for classes
b) A class with methods
c) A class without variables
d) A final class
Answer:
a) A blueprint for classes
Explanation:
An interface in Java is a blueprint for classes, defining methods that the implementing classes must provide. Interfaces allow for multiple inheritance and promote loose coupling between components.
Understanding interfaces is essential for designing scalable and flexible Java applications.
Reference links:
https://www.rameshfadatare.com/learn-java-programming/
https://www.javaguides.net/p/java-tutorial-learn-java-programming.html