若现有 `Person` 类和 `Student` 类,`Student` 类继承自 `Person` 类。`Person` 类定义了 `name` (String 类型) 和 `age` (int 类型) 属性以及 `work()` 和 `info()` 方法。`Student` 类定义了 `grade` (String 类型) 属性和 `study()` 方法。以下哪个描述准确表达了 `Student` 类的特性?
答案解析
继承是面向对象的核心概念,子类会继承父类的非私有成员。`Student` 类继承了 `Person` 类的所有非私有成员,包括 `name`、`age`、`work()` 和 `info()` 方法,并增加了自己的 `grade` 属性和 `study()` 方法。
正确答案:B