1.封装概述 private public 2.实现封装 例子: package com.java1995; public class Student { private String name; private String sex; private int age; public String getName(){ return name; } public void setName(String name){ this.name=name; } public String getSex(…