Hi all,
I am pretty new to Object Oriented programming so the question i am asking might be childish..geeks, pardon me :)
alright,
i have an interface with 5 methods.
Class A is implementing that interface.
Now Class B creates an instance of Class A and calls the methods.
The functions in the Interface all have single parameter of type "Socket".
It kinda looks stupid to pass this one parameter to all the methods.
Is there any way where i can pass it just once and use it??
Please find an example below
Class A
{
Public void Func1(Socket listener)
{}
Public void Func2(Socket listener)
{}
Public void Func3(Socket listener)
{}
Public void Func4(Socket listener)
{}
Public void Func5(Socket listener)
{}
}
Class B
{
Socket server = new Socket();
A instA = new A();
instA.Func1(server);
instA.Func2(server);
instA.Func3(server);
instA.Func4(server);
instA.Func5(server);
}
Thanks in advance
-deathdarts