Bird
0
0

What keyword is used to declare an interface in Java?

easy📝 Conceptual Q2 of 15
Java - Interfaces
What keyword is used to declare an interface in Java?
Ainterface
Bclass
Cimplements
Dextends
Step-by-Step Solution
Solution:
  1. Step 1: Recall Java syntax for interfaces

    The keyword to declare an interface is 'interface'.
  2. Step 2: Differentiate from other keywords

    'class' declares classes, 'implements' is used by classes to use interfaces, 'extends' is for inheritance.
  3. Final Answer:

    interface -> Option A
  4. Quick Check:

    Interface declaration keyword = A [OK]
Quick Trick: Use 'interface' keyword to declare interfaces [OK]
Common Mistakes:
  • Using 'class' instead of 'interface'
  • Confusing 'implements' with declaration
  • Using 'extends' to declare interfaces

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Java Quizzes