ComputerStudent.java 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package exercise.exercise01;
  2. /**
  3. * @author WanJl
  4. * @version 1.0
  5. * @title ComputerStudent
  6. * @description
  7. * @create 2026/7/27
  8. */
  9. public class ComputerStudent extends Student{
  10. private double javaScore;
  11. private double mySQLScore;
  12. public ComputerStudent(Integer id, String name, Integer age, String gender, double javaScore, double mySQLScore) {
  13. super(id, name, age, gender);
  14. this.javaScore = javaScore;
  15. this.mySQLScore = mySQLScore;
  16. }
  17. @Override
  18. public void study() {
  19. System.out.println("计算机专业学生"+this.getName()+"在学计算机");
  20. }
  21. @Override
  22. public void lesson() {
  23. System.out.println("计算机专业学生"+this.getName()+"在上 Java 基础课");
  24. }
  25. public double getJavaScore() {
  26. return javaScore;
  27. }
  28. public void setJavaScore(double javaScore) {
  29. this.javaScore = javaScore;
  30. }
  31. public double getMySQLScore() {
  32. return mySQLScore;
  33. }
  34. public void setMySQLScore(double mySQLScore) {
  35. this.mySQLScore = mySQLScore;
  36. }
  37. }