
- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
What is the implicit implementation of the interface and when to use implicit implementation of the interface in C#?
C# interface members can be implemented explicitly or implicitly.
Implicit implementations don't include the name of the interface being implemented before the member name, so the compiler infers this. The members will be exposed as public and will be accessible when the object is cast as the concrete type.
The call of the method is also not different. Just create an object of the class and invoke it.
Implicit interface cannot be used if there is same method name declared in multiple interfaces
Example
interface ICar { void displayCar(); } interface IBike { void displayBike(); } class ShowRoom : ICar, IBike { public void displayCar() { throw new NotImplementedException(); } public void displayBike() { throw new NotImplementedException(); } } class Program { static void Main() { ICar car = new ShowRoom(); IBike bike = new ShowRoom(); Console.ReadKey(); } }
- Related Articles
- What is explicit implementation and when to use in the interface in C#?
- Checking implementation of interface IF_EX_IDOC_CREATION_CHECK in SAP ABAP
- What is the out implicit object in JSP?
- What is the difference between implicit and explicit type conversion in C#?
- What is the user interface and operating system interface?
- What is the use of setFetchSize() and setMaxRows() methods of the JDBC Statement Interface?
- What is the Microarchitectural implementation of branch processing?
- What is the implementation of a Lexical Analyzer?
- What are implicit type conversions in C#?
- When to use an abstract class and when to use an interface in Java?
- What is the CRM Implementation Plan?
- What is the implementation of FX Pipelines in Computer Architecture?
- What is the role of IWebHostEnvironment interface in C# ASP.NET Core?
- What are the implementation of Triple DES?
- What are implicit and explicit type conversions in C language?

Advertisements