Interface and class(The virtual keyword is required to implement the interface method) : interface « Class « Visual C++ .NET






Interface and class(The virtual keyword is required to implement the interface method)

 
#include "stdafx.h"
interface class IInterface
{
   void f();
   int g();
};

ref class MyClass : IInterface
{
   public:
      virtual void f() { }

      virtual int g() { return 1; }
};

   
  








Related examples in the same category

1.Interface definition
2.base and interface
3.Interface list
4.Interface name collision
5.Interface properties events
6.constants in interfaces
7.interfaces implementing interfaces
8.multiple interfaces
9.static interfaces
10.class interface method ambiguity
11.Explicit interface implementation
12.Private interface