SupportWriter space ↗
REFERENCE LIBRARY

References from other publishers

Republished articles with source attribution. This collection is separate from Diary Coding’s original guides and does not display ads.

Read original guides → · Editorial policy

FOR YOUR CURIOSITY

Latest notes.

CORE API / NOTES</>↗
Core API02 Aug 2008

How do I encrypt an object with DES?

This example demonstrate encrypting an object using DES algorithm. After the object was encrypted we store it in a file which will be decrypted in the next example here How do I decrypt an object with DES. package org.kodejava.crypto; import java.io.*; import javax.crypto.Cipher; import javax.crypto.KeyGenerator; import javax.crypto.SealedObject; import javax.crypto.SecretKey; public class ObjectEncrypt { public static […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API01 Aug 2008

How do I determine whether a string is a palindrome?

This code checks a string to determine if it is a palindrome or not. A palindrome is a word, phrase, or sequence that reads the same backward as forward. package org.kodejava.lang; public class PalindromeChecker { public static void main(String[] args) { String text = "Sator Arepo Tenet Opera Rotas"; PalindromeChecker checker = new PalindromeChecker(); System.out.println("Is […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API29 Jul 2008

How do I create a thread by implementing Runnable interface?

Here is the second way for creating a thread. We create an object that implements the java.lang.Runnable interface. For another example see How do I create a thread by extending Thread class?. package org.kodejava.lang; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; public class TimeThread implements Runnable { private final DateFormat df = new SimpleDateFormat("hh:mm:ss"); // The […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API28 Jul 2008

How do I create a thread by extending Thread class?

There are two ways that we can use tho create a thread. First is by extending the java.lang.Thread class and the second way is by creating a class that implements the java.lang.Runnable interface. See How do I create a thread by implementing Runnable interface? In this example we’ll extend the Thread class. To run a […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API23 Jul 2008

How do I compare two dates?

In this example you’ll see the utilization of SimpleDateFormat class for comparing two dates for equality. We convert the date object into string using the DateFormat instance and then compare it using String.equals() method. package org.kodejava.util; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class ComparingDate { public static void main(String[] args) { // […]

Wayan · 1 min read
APACHE COMMONS / NOTES</>↗
Apache Commons20 Jul 2008

How do I search for files recursively using Apache Commons IO?

This example demonstrates how we can use the FileUtils class listFiles() method to search for a file specified by their extensions. We can also define to find the file recursively deep down into the subdirectories. package org.kodejava.commons.io; import org.apache.commons.io.FileUtils; import java.io.File; import java.util.Collection; public class SearchFileRecursive { public static void main(String[] args) { File root […]

Wayan · 1 min read
✳

Knowledge grows when shared.

Stay curious. There is always something new to learn.

Explore notes ↗
Putu Adi Guna Permana
ABOUT THE AUTHOR

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Writer and founder of Diary Coding — sharing notes, tutorials, and experiences about programming for anyone who wants to keep learning.