title: Multiple inhetitance and protected variable in java()
body: <p>As we know in Java we can't have multiple inheritance and protected variable in interface, so how can I implement this code?</p>
  
  <p><strong>Bar.java</strong></p>
  
  <pre><code>public class Bar {
      protected int  a = 0;
      public void increaseA() {
          a++;
      }
      public void printA() {
          System.out.println(a);
      }
  }
  </code></pre>
  
  <p><strong>Foo.java</strong></p>
  
  <pre><code>public class Foo extends Bar, FooBar {
      @Override
      public void printClassName() {
          printClassName();
          System.out.println("Foo");
      }
  }
  </code></pre>
  
  <p><strong>FooBar.java</strong></p>
  
  <pre><code>public class FooBar {
      void printClassName(){
          System.out.println("FooBar");
      }
  }
  </code></pre>
  
  <p><strong>Main.java</strong></p>
  
  <pre><code>public class Main {
      public static void main(String[] args) {
          Foo foo = new Foo();
          FooBar fooBar = foo;
          foo.printClassName();
          Bar bar = foo;
          bar.increaseA();
          bar.printA();
      }
  }
  </code></pre>