---
title: "Explicit and Implicit interface Implementation in c#."  
description: "Explicit and Implicit interface Implementation"  
author: "Devesh Omar"  
published: 2014-05-30  
updated: 2019-07-17  
canonical: https://www.mindstick.com/articles/1405/explicit-and-implicit-interface-implementation-in-c-sharp  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# Explicit and Implicit interface Implementation in c#.

[Explicit and Implicit](https://www.mindstick.com/interview/2353/what-is-difference-between-explicit-and-implicit-intent) interface [Implementation](https://answers.mindstick.com/qa/44913/who-is-the-minister-of-statistics-and-programme-implementation) in c#

**Consider the code below.**

[Public](https://www.mindstick.com/blog/11097/java-access-modifiers-the-public-and-the-private-modifiers) interface ***IstringInterface***

{ [String](https://www.mindstick.com/interview/22908/what-are-java-string-class-method) str {get;}

}

Public [class](https://www.mindstick.com/blog/165/generic-class-in-c-sharp) ***StringClass***: ***IstringInterface***

{ //Implicit implementation

Public string str

{ Return “Implicit interface Implementation” ;

}

//explicit implemenatation

Public string ***IstringInterface***.str

{ Return “[Explicit interface](https://www.mindstick.com/interview/23214/how-to-implement-explicit-interface) Implementation” ;

}

}

Main()

{ StringClass obj = new StringClass();

//Implicit

Obj.str **//** work fine Calling way 1

(IstringInterface (Obj)).str // **[works fine](https://answers.mindstick.com/qa/50017/is-it-true-if-my-mac-operating-system-can-t-be-upgraded-but-the-mac-still-works-fine-that-i-won-t-get-security-updates) calling way 2**

//Explicit

Obj.str// not works **Calling way 1**

(IstringInterface (Obj)).str // // **works fine calling way 2**

}

For implicit implementation **Calling way 1 and Calling way 2 works fine**

Here, from yellow line, if we will use Explicit implementation then we are not able to call the [method](https://www.mindstick.com/forum/166/webservice-method) directly, only **calling way 2 work**

---

Original Source: https://www.mindstick.com/articles/1405/explicit-and-implicit-interface-implementation-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
