封装
作者:互联网
package oop.demo4;
import oop.demo4.Student;
public class Demo4 {
public static void main(String[] args) {
Student student=new Student();
student.getName();
}
}
package oop.demo4;
public class Student {
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
标签:封装,String,oop,demo4,Student,public,name 来源: https://www.cnblogs.com/Gc-mosi/p/15377386.html