Category Archives for "Java"

Sorting Java Collections

Sorting collections is a common task that Java developers deal with on a daily bases.  The Java Collections class provides us with two sort() methods to sort all collections that implement the List interface. Sorting Primitive Types & Strings In the example below, we will create a list with ten random integers and sort the list using the sort() method, […]

Continue reading

Iterating Over Collections In Java

Iteration is the most common operations done on a collection. For example, you may want to go through all the student grades to find who has the highest test scores. In Java we have four methods for iterating over a collection, the methods are the for loop, iterator, forEach and lambda expressions. Setup Collection Here […]

Continue reading

Using SDKMAN To Manage Java Versions

What Is SDKMAN? As Java developers, we have to work with different versions of Java from project to project. Installing different versions by hand and setting the PATH can become a real pain at times. SDKMAN is a command line tool that allows you to install different versions of Java, Gradle, Maven and more. SDKMAN also takes […]

Continue reading