This tutorial will introduce you to mouse events in Java. You will learn how to program a cursor tracker, which triggers on events such as mouse button pressed, released, clicked, dragged, moved, etc.
Sort an Array of Strings in Reverse Order
Learn how to sort an array efficiently using the sort() method and a custom Comparator in Java.
Find Twin Primes
Find the first 1000 twin prime numbers in Java using an isPrime function for the primality check and a value comparison between the prime numbers.
Validate phone number using RegEx and Java
Java example of how to validate a phone number in various formats using regular expressions. Contextual Ads More Java Resources Advertisement
Function to test for primality
A simple modulus based algorithm used in Java to find if the passed number is prime or not.
Greatest common divisor w/ the Euclidian algorithm
The Euclidian algorithm is being used in a Java function for finding the greatest common divisor. The simple function calls itself (recursion) until the greatest common divisor has been reached, at which point it is returned.
MD5 Encryption Using Java
Demonstrates how to encrypt a string using the MD5 algorithm in Java. Since MD5 is non-reversable, there is no code for decrypting the value.
Minesweeper Game In Java
A fully functional Minesweeper game in Java that is similar to the one bundled with Windows, and that can be easily enhanced.
Get Velocity And Position Of A Projectile
Use Java, physics and simple math to calculate the position of a projectile at a given time and its velocity.
Using Sockets To Retrieve Data Through HTTP
Use the Java Socket object and the BufferedReader to retrieve the response of an HTTP web request.