public static void Main()
ClassA fc=new ClassA(20,true,"classA");
ClassB sc=new ClassB(123.45F,567.344,'g');
ClassC tc=new ClassC(3456666666, 7776.555M,33);
public class ClassA: IConvertible
public TypeCode GetTypeCode()
public bool ToBoolean(IFormatProvider provider)
throw new InvalidCastException();
public double ToDouble(IFormatProvider provider)
public byte ToByte(IFormatProvider provider)
throw new InvalidCastException();
public char ToChar(IFormatProvider provider)
throw new InvalidCastException();
public sbyte ToSByte(IFormatProvider provider)
throw new InvalidCastException();
public short ToInt16(IFormatProvider provider)
throw new InvalidCastException();
public int ToInt32(IFormatProvider provider)
throw new InvalidCastException();
public long ToInt64(IFormatProvider provider)
throw new InvalidCastException();
public ushort ToUInt16(IFormatProvider provider)
throw new InvalidCastException();
public uint ToUInt32(IFormatProvider provider)
throw new InvalidCastException();
public ulong ToUInt64(IFormatProvider provider)
throw new InvalidCastException();
public float ToSingle(IFormatProvider provider)
throw new InvalidCastException();
public decimal ToDecimal(IFormatProvider provider)
throw new InvalidCastException();
public DateTime ToDateTime(IFormatProvider provider)
throw new InvalidCastException();
public string ToString(IFormatProvider provider)
return this.stringVar.ToString();
public Object ToType(Type conversionType, IFormatProvider provider)
throw new InvalidCastException();
Console.WriteLine(this.GetType().Name+ " default constructor");
public ClassA(int i, bool b, string str)
Console.WriteLine(this.GetType().Name+" 3 parameter constructor");
Console.WriteLine(this.GetType().Name +"with parameter: " +c.GetType().Name);
Console.WriteLine((this.GetType().Name + "with parameter " +b.GetType().Name));
public void AMethodOne(ClassB bc)
ClassC cc =new ClassC(bc);
Console.WriteLine( this.GetType().Name+" method with parameter "+ bc.GetType().Name);
public void AMethodTwo(ClassC cc)
ClassB bc =new ClassB(cc);
Console.WriteLine( this.GetType().Name+"method with parameter"+ cc.GetType().Name);
public void AMethodThree(ClassB bc1,ClassC cc1)
Console.WriteLine( this.GetType().Name +"calling both methods");
Console.WriteLine(this.GetType().Name+" default constructor");
public ClassB(float fVar, double dVar, char cVar)
Console.WriteLine(this.GetType().Name+ " 3 parameter constructor");
Console.WriteLine((this.GetType().Name + " with parameter" +c1.GetType().Name));
Console.WriteLine(this.GetType().Name +"with parameter:" +a.GetType().Name);
public void BMethodOne(ClassC cc)
ClassA ac =new ClassA(cc);
Console.WriteLine( this.GetType().Name+"method with parameter"+ cc.GetType().Name);
public void BMethodTwo(ClassA ac)
ClassC cc =new ClassC(ac);
Console.WriteLine( this.GetType().Name+"method with parameter"+ ac.GetType().Name);
public void BMethodThree(ClassC cc2,ClassA ac1)
Console.WriteLine( this.GetType().Name +"calling both methods");
Console.WriteLine(this.GetType().Name+" default constructor");
public ClassC(long Long, decimal dec, short sVar)
dec = 9760790567.945095M;
Long = 568888888888888888;
Console.WriteLine(this.GetType().Name+" 3 parameter constructor");
Console.WriteLine((this.GetType().Name + " with parameter" +a1.GetType().Name));
Console.WriteLine(this.GetType().Name +" with parameter:" +b1.GetType().Name);
public void CMethodOne(ClassA ac)
ClassB bc =new ClassB(ac);
Console.WriteLine( this.GetType().Name+" method with parameter "+ ac.GetType().Name);
public void CMethodTwo(ClassB bc)
ClassA ac =new ClassA(bc);
Console.WriteLine( this.GetType().Name+" method with parameter "+ bc.GetType().Name);
public void CMethodThree(ClassA ac2,ClassB bc2)
Console.WriteLine( this.GetType().Name +" calling both methods ");