Using Protected Fields in Abstract Class in Java

While you can certainly do both ways the protected field way is less desirable and I would argue less idiomatic particularly if this is library code that you plan to share.

You can see this in the Java Collections API as well as Guava. You will be hard pressed to find Abstract classes that have protected fields (let alone any fields).

That being said there are always exceptions and you are not always writing library code (ie public api).

Here is my opinion on protected and/or private fields and abstract classes. If you are going to do it than make a constructor that takes the initial values:

public abstract class Animal {
    private int height;
    public Animal(int height) { this.height = height; }
    public int getHeight() { return this.height }
}

public class Cat extends Animal {
    public Cat() {
        super(2);
    }
}

Now your subclasses are required to set height to something as they have to call the constructor that takes height.