hi...this is Rathi...i attended last session...all we discussed abt Oops concept....its pretty useful..esp for those who r freshers...
as one of the friend queried ...if two interface with same method been inherited..is it possible or not...so for that query one of my senior friend explained how to handle this...the example code snippet given below...
class TestInterface : Interface1,Interface2
{
#region Interface1 Members
void Interface1.Update(string t1)
{
throw new NotImplementedException();
}
#endregion
#region Interface2 Members
void Interface2.Update(string t1)
{
throw new NotImplementedException();
}
#endregion
}
class Program
{
static void Main(string[] args)
{
TestInterface tinterface = new TestInterface();
Interface1 inter1 = tinterface as Interface1; // Here the TYPE CASTING taken place...not boxing/Unboxing..becoz both interface ansd class are reference type...so boxing/unboxing not possible....
inter1.Update("Test Interface1");
Interface2 inter2 = tinterface as Interface2;
inter2.Update("Test Interface2");
}
}
Webmaster, if this helps please login to Mark As Answer. | Alert Moderator