πŸ“’ Too many exams? Don’t know which one suits you best? Book Your Free Expert πŸ‘‰ call Now!

  • google app store apple app store
  • βœ–

      Question

      What is an interface in OOP (e.g., Java,

      C#)?
      A A class that can be instantiated but cannot be inherited. Correct Answer Incorrect Answer
      B A blueprint of a class that contains only abstract methods and constants. Correct Answer Incorrect Answer
      C A class that provides a default implementation for all its methods. Correct Answer Incorrect Answer
      D A mechanism for multiple inheritance of implementation. Correct Answer Incorrect Answer
      E A way to hide data from external access. Correct Answer Incorrect Answer

      Solution

      An interface defines a contract: it specifies a set of methods that a class must implement. It typically contains only method signatures (abstract methods) and constant fields, without providing any implementation details (though Java 8+ allows default and static methods).

      Practice Next
      ask-question