Re: Interface methods body
Its not possible to declare one interface methods in different classes.
If you are implementing any interface,you should implement all the methods in that interface.means full implementation should be done
Re: Interface methods body
You can not do this... I think the only way to achieve, what you are trying to do is, create two different interfaces.
Re: Interface methods body
You can override two methods of interface in two different classes by declaring them abstract.
e.g.
interface i
{
void read();
void print();
}
abstract class test implements i
{
public void read()
{
MessageBox.Show("from read...test");
}
}
abstract class best implements i
{
public void print()
{
MessageBox.Show("from print...best");
}
}
You can not instantiate these classes.
to instantiate them, you need to again inherit these classes.
e.g.
class test_child inherits test
{
public void print()
{
}
}
abstract class best_child inherits best
{
public void print()
{
}
}
private void button1_Click(object sender, EventArgs e)
{
test_child t = new test();
best_child b = new best();
i x = new test_child();
x.read();
i y = new best_child();
y.print();
}