For example, class `Base` has two public methods: `foo()` and `bar()`. Class `Derived` is inherited from class `Base`. In class `Derived`, I want to make `foo()` public but `bar()` private. Is the following code the correct and natural way to do this?

```
class Base {
   public:
     void foo();
     void bar();
};

class Derived : public Base {
   private:
     void bar();
};

```