I have a question regarding implementing multiple interfaces in vb.net versus c#. This code works good in c#:
but the "equivalent" code (so I think) in vb.net:
gives an error stating that I must implement Sub LookupPassword(), so when I change the method declaration to
I still get the same error, but now I also get an error:
LookupPassword cannot implement LookupPassword because there is no matching sub on interface IDatabaseUser
Is there a fundamental difference in implementing multiple interfaces between c# and vb.net or am I doing something wrong here that is simple to correct?
Code:
interface IDatabaseUser
{
void LookupPassword();
}
interface ITestUser
{
void LookupPassword();
}
public class testcode : IDatabaseUser, ITestUser
{
public void LookupPassword()
{
//
}
void ITestUser.LookupPassword()
{
//
}
}
Code:
Public Interface IDatabaseUser
Sub LookupPassword()
End Interface
Public Interface ITestUser
Sub LookupPassword()
End Interface
Public Class User
Implements IDatabaseUser, ITestUser
Public Sub LookupPassword()
End Sub
Public Sub LookupPassword() Implements ITestUser.LookupPassword
End Sub
Code:
Public Sub LookupPassword() Implements IDatabaseUser.LookupPassword
LookupPassword cannot implement LookupPassword because there is no matching sub on interface IDatabaseUser
Is there a fundamental difference in implementing multiple interfaces between c# and vb.net or am I doing something wrong here that is simple to correct?