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.

APACHE COMMONS / NOTES</>↗
Apache Commons09 Jul 2008

How do I delete directory recursively?

Using the FileUtils.deleteDirectory() from the Apache Commons IO library, we can simplify the process of deleting directory and everything below it recursively. package org.kodejava.commons.io; import org.apache.commons.io.FileUtils; import java.io.File; import java.io.IOException; public class DeleteDirectory { public static void main(String[] args) { try { File directory = new File("F:/Temp"); // Deletes a directory recursively. When a deletion […]

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

How do I create a human-readable file size?

This example demonstrates how to create a human-readable file size using the FileUtils class of the Apache Commons IO library. The byteCountToDisplaySize() method take the file size in bytes and return a human-readable display of the file size in bytes, kilobytes, megabytes, gigabytes, etc. package org.kodejava.commons.io; import org.apache.commons.io.FileUtils; import java.io.File; public class ReadableFileSize { public […]

Wayan · 1 min read
BASIC / NOTES</>↗
Basic03 Jul 2008

What is @SuppressWarnings annotation?

The @SuppressWarnings annotation tells the compiler to suppress the warning messages it normally shows during compilation time. It has some level of suppression to be added to the code, these level including: all, deprecation, fallthrough, finally, path, serial and unchecked. package org.kodejava.basic; import java.util.Calendar; import java.util.Date; public class SuppressWarningsExample { @SuppressWarnings(value={"deprecation"}) public static void main(String[] […]

Wayan · 1 min read
BASIC / NOTES</>↗
Basic29 Jun 2008

How do I use @Override annotation?

We use the @Override annotation as part of method declaration. The @Override annotation is used when we want to override methods and want to make sure have overridden the correct methods. As the annotation name we know that there should be the same method signature in the parent class to override. That means using this […]

Wayan · 1 min read
BASIC / NOTES</>↗
Basic28 Jun 2008

How do I mark method as @deprecated?

To mark a method as deprecated we can use the JavaDoc @deprecated tag. This is what we did since the beginning of Java. But when a new metadata support introduced to the Java language we can also use annotation. The annotation for marking method as deprecated is @Depreated. The difference between these two that the […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API24 Jun 2008

How do I programmatically compile Java class?

This example using the Java Compiler API introduced in JDK 1.6 to programmatically compile a Java class. Here we’ll compile the Hello.java. The process of compiling can be start by obtaining a JavaCompiler from the ToolProvider.getSystemJavaCompiler(). The simplest way to compile is by calling the run() method of the compiler and passing the first three […]

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.