Home > Back-end > What a great god can see the Student stu: what is the meaning of students and how to use this flag
What a great god can see the Student stu: what is the meaning of students and how to use this flag
Time:11-26
Public class StudentDAOImpl implements IStudentDAO { Public static List Students=new ArrayList (a);
Public void deleteStudent (String sno) { A Boolean flag=false; If (students. The size () & gt; 0) { For (Student stu: students) { If (stu. GetSno (.) the equals (sno)) { flag=true; Students. Remove (stu); System. Out.println (" the student id student deleted successfully!" ); } } if(! Flag) { System. Out.println (" database without the student record!" ); } } The else { System. Out.println (" no student record in the database!" );
} }
CodePudding user response:
Student stu: students enhanced for loop students is a collection and stu is traversed each Student entity class
Flag is a Boolean value that is true or false! Flag of them! Is the invert, is if the flag is true to use! Is false, if the flag is false use! It is true