A
AshokG
Hi,
Consider this code in VB.NET project ClassLibrary1...
Public Interface ITest
Function Name() As String
Function Age() As Integer
End Interface
Public Class Test
Implements ITest
Private Function Age() As Integer Implements ITest.Age
Return 10
End Function
Public Function Name() As String Implements ITest.Name
Return "Test"
End Function
End Class
And a new C# (VB.NET too) Console Project and referefer above ClassLibrary1
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
ClassLibrary1.ITest t = new ClassLibrary1.Test();
Console.WriteLine(t.Age());
}
}
Note that Age is private in VB is getting accessing from C#/VB.NET through
interface... -Huh
C# doen't allow this as it won't compile!
Regards
Ashok
Consider this code in VB.NET project ClassLibrary1...
Public Interface ITest
Function Name() As String
Function Age() As Integer
End Interface
Public Class Test
Implements ITest
Private Function Age() As Integer Implements ITest.Age
Return 10
End Function
Public Function Name() As String Implements ITest.Name
Return "Test"
End Function
End Class
And a new C# (VB.NET too) Console Project and referefer above ClassLibrary1
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
ClassLibrary1.ITest t = new ClassLibrary1.Test();
Console.WriteLine(t.Age());
}
}
Note that Age is private in VB is getting accessing from C#/VB.NET through
interface... -Huh
C# doen't allow this as it won't compile!
Regards
Ashok