Java Basics
-
Java offline installer – How to install Java in Windows
In this tutorial we will show you how to install the latest Java version in Windows, using the Java offline…
Read More » -
Substring Java Example
In this post, we feature a comprehensive Substring Java Example. We will show how to use Java String substring() API method.…
Read More » -
java.lang.NullPointerException Example – How to handle Java Null Pointer Exception (with video)
In this post, we feature a comprehensive example of java.lang.NullPointerException – Java Null Pointer Exception. In Java, a special null value can…
Read More » -
Synchronization with multiple locks
The basic idea is to use separate locks to guard multiple independent state variables of a class, instead of having…
Read More » -
Synchronized method and block
The first level of synchronization is on method scope: public class HelloSync { private Map dictionary = new HashMap(); public…
Read More » -
Simple Do While loop Java Example
1. Introduction A do-while loop in Java is a control flow statement that executes a block of code at least once, and then repeatedly executes…
Read More » -
Sum Array of Numbers with for loop
This is an example of how to get the sum of the numbers in an array using a for loop. The…
Read More » -
Check for Palindrome Number with for loop
In this example we shall show you how to check if a palindrome number exists in an array, using a…
Read More » -
Generate Prime Numbers with for loop
With this example we are going to demonstrate how to generate prime numbers with a simple for loop. A prime…
Read More » -
Simple for loop
This is an example of a simple for statement. The for statement provides a compact way to iterate over a…
Read More »