title: Java access a protected attribute
body: <p>I am new to Java, need some help</p>
  
  <p>I have an abstract superclass that has 2 protected attributes </p>
  
  <pre><code>public abstract class Superclass {
    protected int a = 0;
    protected int b = 0;
    ...
    }
  </code></pre>
  
  <p>then I have a subclass that extends the superclass, and i wish to access a and b, but I dont know how. I searched the web and didnt find anything. </p>
  
  <pre><code>public class Subclass extends Superclass {
    public boolean someMethod(){
    .....
    // at the end i need to do
    a += 1;
    return true
    }
  }
  </code></pre>
  
  <p>I get the compilation error:
  "unreachable statemen"</p>
  
  <p>thanks for your help. </p>