/* public void FancyMethod(Student st)
  * {
  *  st.PrintMe();
  * }
  * public void FancyMethod(Instructor instructor)
  * {
  *  instructor.PrintMe();
  * }*/
 public static void MyFancyMethod(ISayHello myObj) // static for main to access it.
 {
     myObj.PrintMe();
 }
示例#2
0
        //public void FancyMethod(Student st)
        //{
        //    st.PrintMe();
        //}

        //public void FancyMethod(Instructor st)
        //{
        //    st.PrintMe();
        //}

        public static void MyFancyMethod(ISayHello myObj)
        {
            myObj.PrintMe();
        }