Java - InterfacesWhich statement about static methods in Java interfaces is true?AStatic methods in interfaces must be overridden by implementing classes.BStatic methods in interfaces can be called without an instance.CStatic methods in interfaces cannot have a body.DStatic methods in interfaces are inherited by subclasses.Check Answer
Step-by-Step SolutionSolution:Step 1: Understand static methods in interfacesStatic methods belong to the interface itself, not to instances or subclasses.Step 2: Analyze method call behaviorThey can be called using the interface name directly, without creating an object.Final Answer:Static methods in interfaces can be called without an instance. -> Option BQuick Check:Static method call = without instance [OK]Quick Trick: Call static interface methods using InterfaceName.method() [OK]Common Mistakes:Thinking static methods must be overriddenAssuming static methods are inheritedBelieving static methods cannot have bodies
Master "Interfaces" in Java9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Java Quizzes Classes and Objects - Object interaction - Quiz 1easy Custom Exceptions - Creating custom exception class - Quiz 1easy Custom Exceptions - Why custom exceptions are needed - Quiz 4medium Encapsulation - Private data members - Quiz 2easy Inheritance - Super keyword - Quiz 8hard Inheritance - Why inheritance is used - Quiz 1easy Interfaces - Implementing interfaces - Quiz 1easy Interfaces - Implementing interfaces - Quiz 4medium Interfaces - Interface declaration - Quiz 10hard Object-Oriented Programming Concepts - Why object-oriented programming is used - Quiz 1easy