    #include <iostream>
 
    class Interface
    {
    public:
        virtual ~Interface() {}
        virtual void myIfMethod() = 0;
    };
 
    class Derived : public Interface
    {
    private:
        void myIfMethod(){std::cout << "private method invoked via public interface" << std::endl;}
    };
 
    int main()
    {
        Interface* myObj = new Derived;
        myObj->myIfMethod();
        delete myObj;
        return 0;
    }