Treefish Zhang
Treefish Zhang

Reputation: 1161

Could the Oracle docs on JavaBean be wrong?

In this Oracle Doc on JavaBeans, we see:

public class FaceBean {
    private int mMouthWidth = 90;

    public int getMouthWidth() {
        return mMouthWidth;
    }

    public void setMouthWidth(int mw) {
        mMouthWidth = mw;
    }
}

Shouldn't the property be mouthWidth instead?

Upvotes: 0

Views: 31

Answers (1)

Jarett LeVan
Jarett LeVan

Reputation: 389

Nope, some programmers put m in front of their variables to show that they are "member" variables, which is what you are seeing here.

Upvotes: 6

Related Questions