INTRODUCTION TO NET
APPLICATION DEVELOPMENT
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
True
|
|
False
|
|
Either A or B
|
|
None of the above
|
Detailed explanation-1: -The Interface Segregation Principle (ISP) states that a client should not be exposed to methods it doesn’t need. Declaring methods in an interface that the client doesn’t need pollutes the interface and leads to a “bulky” or “fat” interface.
Detailed explanation-2: -The differences are significant. An interface cannot implement any methods, whereas an abstract class can. A class can implement many interfaces but can have only one superclass. An interface is not part of the class hierarchy.
Detailed explanation-3: -Interface segregation principle states: A client should never be forced to implement an interface that it doesn’t use, or clients shouldn’t be forced to depend on methods they do not use.
Detailed explanation-4: -Definition of the interface segregation principle The Interface Segregation Principle was defined by Robert C. Martin while consulting for Xerox to help them build the software for their new printer systems. He defined it as: “Clients should not be forced to depend upon interfaces that they do not use.”
Detailed explanation-5: -Explanation: Small interfaces should be combined to form a large interface. Interfaces should provide general functionality for multiple clients. Clients should not be forced to depend on interfaces that they do not use.