Java Quadratic equation solution

In algebra, a quadratic equation (from Latin quadratus ‘square‘) is any equation that can be rearranged in standard form as: ax2 + bx + c = 0 This java program will try to find the roots of this quadratic equation based on the parameters a, b and c. This parameters are required to be given as input from the console and then … Read more

Java remove elements from collection by filtering

One of the way to remove elements of collection (in this example list) is to use method removeIf Method declaration: default boolean removeIf(Predicate<? super E> filter) Description: Removes all of the elements of this collection that satisfy the given predicate. Errors or runtime exceptions thrown during iteration or by the predicate are relayed to the caller. … Read more

Java asymmetric set difference

If you need to find difference between two sets you can use method removeAll. The difference will be kept only on the set which is calling the method. Definition: booleanremoveAll(Collection<?> c) Description: Removes from this set all of its elements that are contained in the specified collection (optional operation). If the specified collection is also a … Read more