为什么 VS Code 会出现我的字段是私有的问题?

问题描述

我首先将字段设为私有,但 VS Code 不喜欢那样,所以我将其切换为受保护的。我习惯用 C/C++ 编码,所以我不确定是否有我遗漏的东西......

有人知道为什么我不能将我的字段设为私有吗?

public abstract class Employee 
{
    protected String firstName;
    protected String lastName;
    protected int id;

    public Employee()
    {
        this.firstName="Plony";
        this.lastName="Almoni";
        this.id=0;
    }

    public Employee(String FN,String LN,int ID)
    {
        this.firstName=FN;
        this.lastName=LN;
        this.id=ID;
    }
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)