I have an interface and that interface contain one method test(). I have class and I have implemented that interface and provided the definition for that interface method i.e test(). I have created an object of that class and I try to access the the test() method with that class object. I am successfully able to access the test() method with class object.
Now My questions is how to present that test() methods not accessible with my class object. Is this possible?
If yes, then how?
Code:-
interface test
{
void test();
}
class a : test
{
public void test()
{
}
}
class Program
{
static void Main(string[] args)
{
a obj = new a();
obj.test(); //Here I don't want to display test(). This should give error for me.
}
}