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 API22 Mar 2006

How do I terminate a Java application?

In an application we sometimes want to terminate the execution of our application, for instance because it cannot find the required resource. To terminate it we can use exit(status) method in java.lang.System class or in the java.lang.Runtime class. When terminating an application we need to provide a status code, a non-zero status assigned for any […]

Wayan · 1 min read
SERVLET / NOTES</>↗
Servlet18 Mar 2006

How do I get a spring’s bean from a servlet?

I have created a servlet based web application, and I want to used Spring beans in it. So how do I do this in my servlet. Well, it is simple enough to do this. First, I have to obtain the Spring’s WebApplicationContext, from where I can grab the required bean by my servlet. Let’s see […]

Wayan · 4 min read
APACHE COMMONS / NOTES</>↗
Apache Commons17 Mar 2006

How do I use Apache Commons Lang ToStringBuilder class?

The toString() method defined in the java.lang.Object can be overridden when we want to give more meaningful information about our object. We can simply return any information of the object in the toString() method, for instance the value of object’s states or fields. The Apache Commons Lang library offers a good utility for creating this […]

Wayan · 3 min read
SERVLET / NOTES</>↗
Servlet15 Mar 2006

How do I count number of online users?

When you have a web application you might want to know how many users are currently online or connected to your website. If you have visited some web online forums you can see; usually on the first page; the list of their online users or maybe just the number of currently online users. How do […]

Wayan · 3 min read
CORE API / NOTES</>↗
Core API14 Mar 2006

How do I create and write data into text file?

Here is a code example for creating text file and put some texts in it. This program will create a file called write.txt. To create and write a text file we do the following steps: File file = new File("write.txt"); FileWriter fileWriter = new FileWriter(file); BufferedWriter bufferedWriter = new BufferedWriter(fileWriter); Below is the complete code […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API13 Mar 2006

How do I read a text file using BufferedReader?

The code snippet below is an example of how to read a text file using BufferedReader class from the java.io package. This snippet read a text file called README.md and print out its content. To create an instance of java.io.BufferedReader we do the following steps: File file = new File("README.md"); FileReader fileReader = new FileReader(file)); […]

Wayan · 2 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.