English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The best way to learn Java programming is through example practice. This page contains examples of Java basic concepts. It is recommended that you refer to the references in these examples and try to use them yourself. All the programs on this page have been tested and should run on all platforms.
Java programs to find the greatest common divisor of two numbers
Java programs to find the least common multiple of two numbers
Java programs to display characters from A to Z using a loop
Java programs to calculate the number of digits in an integer
Java programs to display prime numbers between two intervals
Java programs to display Armstrong numbers between two intervals
Java programs to display prime numbers between two intervals using a function
Java programs to display Armstrong numbers between two intervals using a function
Java programs to create a simple calculator using switch ... case
Java programs to check if a number can be expressed as the sum of two prime numbers
Java programs to find the sum of natural numbers using recursion
Java programs to find the factorial of a number using recursion
Java programs to find the greatest common divisor using recursion
Java programs use multidimensional arrays to add two matrices
Java programs use multidimensional arrays to multiply a matrix
Java programs multiply two matrices by passing a matrix to a function
Java program finds the number of occurrences of a character in a string
Java program calculates the number of vowels and consonants in a sentence
Java program adds two complex numbers by passing a class to a function
Java program calculates the time difference between two time periods
Java program implements the conversion between a character and a string
Java program sorts an ArrayList of custom objects by property
Java program converts a string type variable to a boolean value
Java program converts a double precision type variable to int
Java program converts a string variable to a double precision
Java programs convert double-precision type variables to strings
Java programs convert primitive types to objects and vice versa
Java programs calculate all permutations and combinations of strings
Java programs capitalize the first letter of each word in a string
Java programs differentiate between the == operator and equals() method for strings
Java programs get the name and version of the operating system
Java programs check if two of the three boolean variables are true
Java programs check birthdays and print happy birthday messages
Java programs get the middle element of LinkedList in one pass
Java Program to Calculate the Number of Leaf Nodes in a Tree
Java Program to Check if a String is a Valid Reorganization of Two Strings