Home > Back-end >  How this topic in the Java implementation, thanks
How this topic in the Java implementation, thanks

Time:09-24

This topic how to simple programming, thanks to help
,

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);
List Stus=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 (List Stus) {
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:

refer to the original poster weixin_47695731 response:
this topic how to simple programming,
thank you for your help

The forehead to write how much you give a response to the ah,,,, or is already finished,,,

CodePudding user response:

The
reference 3 floor YangjulongTrue response:
Quote: refer to the original poster weixin_47695731 response:

This topic how to simple programming, thanks to help

The forehead to write how much you give a response to the ah,,,, or is already finished,,,

Sorry, done, so I forgot all about it

CodePudding user response:

And you don't have the test class

CodePudding user response:

refer to 6th floor weixin_47695731 response:
and you don't have the test class,

The main method in the second row is not three?