嗨,我们如何在实时场景中实现接口?接口实现时不透露实现接口的类
这是我的情况
我已经有2种方法
void SaleTransaction();
void VoidTransaction();
接口IPayPal现在我有一个类的PayPal,将实现该服务。
class PayPal:IPayPal{
public void SaleTransaction(){
// Implementation happens here
}
public void VoidTransaction(){
// Implementation happens here
}
}
现在我有一个来自PayPal
请求服务的服务让说
class Service{
IPayPal pp=null;
static void Main(){
pp=new PayPal();
//Now i do not want to expose all the methods in my class PayPal
// is there any other way to just show pp.SaleOneTransaction() method?? i donot want the //PayPal class to be present in this Program..
//Please tell me how to acheive this.
}
}
即请告诉我的方式。我在初始化我的接口类不透露类实现接口。
感谢