This is not possible in Scala. Since Scala has no static notation, you cannot access protected static members of the parent class. This is a known limitation .
The workaround is to do something like this:
// Java public class BaseStatic extends Base { protected int getCount() { return Base.count; } protected void setCount(int c) { Base.count = c; } }
Now you can inherit this new class and access the static element through the getter / setter methods:
// Scala class Derived extends BaseStatic { println(getCount()); }
This is ugly, but if you really want to use protected static members, then what you need to do.
source share