There's another access modifier, which would be the appropriate one in this case:
protected
"Protected" members are accessible to the declaring class and to its subclasses, but not from outside.
So this will work:
protected int a, b, result;
edit:
If you don't specify an access modifier explicitly, private is the default (for class members). So this:
int a, b, result;
is equivalent to
private int a, b, result;
and private members aren't accessible to subclasses.
My suggestion: Always specify all access modifiers explicitly, for members as well as for classes.