Here In my project, I need to add only the first two price of books of the library collection(for condition name="java") and return it in a decimal attribute(booksDecInfo)
If the iteration come across different name, the iteration must break.
Through this,
Though I have the same name, I must not add the 4th book's price to the returning value.
Consider a collection in which we have name and price....
The Specified name(in condition) may be found in many instances or it may not be present in the collection....
If the first few attributes are with the specified name(in condition) and present subsequently, then I need the price values of those attributes to be added and displayed....
And if the specified name is not found subsequently, I don't want my price to be added.......
Here the important issue is >>> For this process I don't want my collection to be sorted in any order.....