Files
javaSE251223/day06/src/com/inmind/object_private03/Teacher.java
2025-12-29 10:23:03 +08:00

47 lines
780 B
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.inmind.object_private03;
//标准的java类
public class Teacher {
private String name;
private double salary;
private int age;
//alt+inset
//构造方法
public Teacher(String name, double salary, int age) {
this.name = name;
this.salary = salary;
this.age = age;
}
public Teacher() {
}
//get/set
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getSalary() {
return salary;
}
public void setSalary(double salary) {
this.salary = salary;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
}