,
CodePudding user response:
package com. Yang;
import java.util.Arrays;
Import the Java. Util. List;
Import the Java. Util. Set;
Public class StudehtDemo {
Public static void main (String [] args) {
School. SetLine (100);
ListStus=Arrays. AsList (new Student (" zhang ", 1, 80, 300), a new Student (" detective ", 2, 380, 300), a new Student (" bill ", 3, 180, 300));
Enroll. Success (stus);
}
}
The class School {
Private static int line;
Public static int getLine () {
return line;
}
Public static void setLine (int line) {
School. The line=line;
}
}
The class Student {
private String name;
private int id;
Private double total;
Private double sport;
Public Student (String name, int id, double the total, double sport) {
super();
this.name=name;
this.id=id;
This. Total=total;
This. Sport=sport;
}
Public String getName () {
Return the name;
}
Public void elegantly-named setName (String name) {
this.name=name;
}
Public int getId () {
return id;
}
Public void setId (int id) {
this.id=id;
}
Public double getTotal () {
Return the total;
}
Public void setTotal (double total) {
This. Total=total;
}
Public double getSport () {
Return to sport.
}
Public void setSport (double sport) {
This. Sport=sport;
}
@ Override
Public String toString () {
//TODO Auto - generated method stub
Return "candidate number" + this. Id + "name" + this. The name + "admission results";
}
}
The class Enroll {
Public static void success (ListStus) {
Stus. Stream ()
The forEach (u - & gt; {System. Out. Println (u + ((u.g etTotal () & gt; School. GetLine () | | (u.g etSport () & gt; 96 & amp; & U.g etTotal () & gt; 300)?" Qualified ":" unqualified ")); });;
}
}
CodePudding user response:
CodePudding user response: