以下是 Java 代码示例:
class Example {
private int num;
private String name;
private void setNum(int num) {
this.num = num;
}
private void setName(String name) {
this.name = name;
}
private int getNum() {
return num;
}
private String getName() {
return name;
}
}