News

Learn how to use Java annotations to associate metadata with classes, methods, and other application elements in your Java programs. There are times when you need to associate metadata, or data ...
Using assertions can greatly increase your confidence in the correctness of your code. How to write an assertion in Java Assertions are implemented via the assert statement and java.lang ...
Analyze the time and space complexity of your solution. Compare your solution to others and identify areas for improvement.
In Java, we don’t need to write “THEN.” Instead, we use an open curly bracket to say that everything that follows is part of that “code block” and should run under the conditions we specify.
It was never the sexiest language, but for decades Java has been a mainstay of modern technology, and it's going to be with us for years to come.
With typical, standalone Java programs, developer must compile source code into bytecode with the javac utility, and then run that bytecode on the JVM. That’s not necessary with JShell. JShell reads ...
More to the point, Java 8 is no longer supported by Oracle. Java 11 and Java 17 are the new LTS Java releases. The next LTS release, Java 21, is coming in 10 months. If you are using Java 8, you must ...
The example code below shows how to use Java’s DirectoryStream in a method to list the files of a directory: public Set<String> listFilesUsingDirectoryStream(String dir) ...
This post explains how to use loops in Java. Learn for loops, while loops, do while, break, and continue. All without going loopy!