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 API05 Jul 2007

How do I use DataInputStream and DataOutputStream?

java.io.DataOutputStream and java.io.DataInputStream give us the power to write and read primitive data type to a media such as file. Both of these classes have the corresponding methods to write primitive data type and to read it back. Using this class make it easier to read int, float, double data and others without needing to […]

Wayan · 3 min read
CORE API / NOTES</>↗
Core API03 Jul 2007

How do I use RandomAccessFile class?

This is an example of using RandomAccessFile class to read and write data to a file. Using RandomAccessFile enable us to read or write to a specific location in the file at the file pointer. Imagine the file as a large array of data that have their own index. In the code below you’ll see […]

Wayan · 2 min read
SERVLET / NOTES</>↗
Servlet02 Jul 2007

How do I get servlet request headers information?

package org.kodejava.servlet; import java.io.IOException; import java.io.PrintWriter; import java.util.Enumeration; import javax.servlet.Servlet; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet(urlPatterns = "/request-headers") public class ServletRequestHeader extends HttpServlet implements Servlet...

Wayan · 2 min read
SERVLET / NOTES</>↗
Servlet01 Jul 2007

How do I get servlet request URL information?

In the code example below we will extract information regarding the HTTP (Hypertext Transport Protocol) from the request object (HttpServletRequest). We will extract the protocol used (http / https), server name and its assigned port number. We will also read our application context path, servlet path, path info and the query string. If we combine […]

Wayan · 3 min read
CORE API / NOTES</>↗
Core API28 Jun 2007

How do I create a directories recursively?

The code below use File.mkdirs() method to create a collection of directories recursively. It will create a directory with all its necessary parent directories. package org.kodejava.io; import java.io.File; public class CreateDirs { public static void main(String[] args) { // Define a deep directory structures and create all the // directories at once. String directories = […]

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

How do I compare string regardless of their case?

Here is an example of comparing two strings for equality without considering their case sensitivity. To do this we can use equalsIgnoreCase() method of the String class. Let’s see an example below: package org.kodejava.basic; public class EqualsIgnoreCase { public static void main(String[] args) { String uppercase = "ABCDEFGHI"; String mixed = "aBCdEFghI"; // To compare […]

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.