Before Java 8, sorting objects in collections is a bit awkward and verbose in terms of the amount of codes you need to put in. With Java 8, things got easier because of Lambda expressions.
Java – Copy array by range
This post will show you how to copy a subset elements of an array by range. For example, copy elements from index 3 to 4 (exclusive). The range values work in the same way as the String’s substring method.
Java Compare Multidimensional Arrays Of Reference Types
This post shows how to compare two multidimensional arrays of reference types in Java. The codes will examine if they are the same in terms of element values and their locations. For example, we want to compare a modified array
Java 8 – Redeclare default methods
In Java, you can extend from another interface using the extends keyword. But Java 8 has default methods. What happens if we extend another interface that has the same default methods as our interface?
It gets re-declared in the “child” interface.
Java – Beyond String Pool
The String Pool is a location in the Java Virtual Machine (JVM) that collects all the literal Strings from your codes. Java keeps unique Strings for reuse.
Create Your Own Functional Interface in Java 8
What is a Functional Interface? [wp_ad_camp_1] Java 8 offers Lambda expressions to help us write better, and concise codes. Lambda expressions revolve around Functional Interfaces. So, what are Functional Interfaces? The simplest definition is: Functional Interfaces are Java Interfaces with
Converting Between array and List in Java
Converting Between array and List in Java.
Java 8 Convert values in a Stream using Map
Convert any value or object to a different type. For instance, MyEntityBean to MyEntityAPI. No loops. Just Lambda.
Java 8 Get the Min and Max values in a Stream
Do you remember your first programming assignment in college? Most like it is one of those simple Mathematics like get the min and max values from a given list. How about from a list of objects?
Java Primitive Float And Double – What’s the difference?
Any floating-point literal in Java is by default of a double type.