+ 1

How to do linear search to find student mark in java coding?

31st Jan 2019, 12:21 AM
Malvin Michael
Malvin Michael - avatar
2 Answers
+ 6
This is a basic search algorithm for any programming language. I checked your profile and you just started java. I suggest you finish the java course first to get a feel of its concepts. https://www.sololearn.com/learn/766/?ref=app
31st Jan 2019, 12:58 AM
Lambda_Driver
Lambda_Driver - avatar
0
The better is to have a collection and operate over it. example: Optional<Student> findStudent(Collection<Student> col, String id){ return col.stream() .filter(student -> student.getId().equals(id)) .findFirst(); }
3rd Feb 2019, 2:56 PM
Manuel Soto
Manuel Soto - avatar