how referencing a class through interface???

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ankitamca85
    New Member
    • Feb 2008
    • 12

    how referencing a class through interface???

    referencing a class through interface???
  • balame2004
    New Member
    • Mar 2008
    • 142

    #2
    Hi,

    Try this:

    --------------------------------
    Interface : IHuman
    Classes : Man,Woman

    public interface IHuman
    {
    public void SetAge(int age);
    public void SetName(int name);
    }


    Class Man :

    public class Man : IHuman
    {
    public override void SetAge(int age)
    {
    Console.WriteLi ne(age.ToString ());
    }
    public override void SetName(int name)
    {
    Console.WriteLi ne(name.ToStrin g());
    }
    }

    ----------------------------

    Balaji U

    Comment

    Working...