zoukankan      html  css  js  c++  java
  • student

    package student;

    public class students {
    private int studentId;
    private String studentName;
    private double averageScore;
    private static int nextId = 1;

    public students(String name,double score) {
    studentId = nextId;
    nextId++;
    studentName = name;
    averageScore = score;
    }

    public students(String name){
    this(name,0);
    }

    public students(){
    this("",0);
    }

    public String toString(String name) {
    return name;
    }
    public int getStudentId(){
    return studentId;
    }
    public void setStudentId(int studentId){
    this.studentId = studentId;
    }
    public String getStudentName(){
    return studentName;
    }
    public void setStudentName(String studentName){
    this.studentName = studentName;
    }
    public double getAverageScore(){
    return averageScore;
    }
    public void setAverageScore(double averageScore){
    this.averageScore = averageScore;
    }
    public static void main(String[] args) {

    }

    }

    package student;

    public class operate {
    private students s1 = new students("zhangsan",10.77);
    private students s2 = new students("lisi",11.44);
    private students s3 = new students("wangwu",12.11);

    public static void main(String[] args) {

    operate op = new operate();

    System.out.println(" Id " +op. s1.getStudentId() + " Name " + op.s1.getStudentName() + " Averagescore "
    + op.s1.getAverageScore());
    System.out.println(" Id " + op.s2.getStudentId() + " Name " +op. s2.getStudentName() + " Averagescore "
    + op.s2.getAverageScore());
    System.out.println(" Id " + op.s3.getStudentId() + " Name " +op. s3.getStudentName() + " Averagescore "
    + op.s3.getAverageScore());
    }

    }

    package student;

    public class collageStudent extends students{
    private int courseNum;
    private float creditHour;

    public static void main(String[] args) {

    }

    }

  • 相关阅读:
    14.3 Go iris
    14.2 Go性能优化
    14.1 Go数据结构
    13.3 Go章节练习题
    13.2 Go练习题答案
    13.1 Go练习题
    12.1 Go nsq
    11.3 Go 开发博客
    11.2Go gin
    11.1 Go Http
  • 原文地址:https://www.cnblogs.com/the-wang/p/6479021.html
Copyright © 2011-2022 走看看