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 API16 Sep 2006

How do I use LineNumberReader class to read file?

In this example we use LineNumberReader class to read file contents. What we try to do here is to get the line number of the read data. Instead of introducing another variable; an integer for instance; to keep track the line number we can utilize the LineNumberReader class. This class offers the getLineNumber() method to […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API12 Sep 2006

How do I get user home directory name?

package org.kodejava.lang; public class UserHomeExample { public static void main(String[] args) { // This is the key that we used to obtain user home directory // in the operating system String userHome = "user.home"; // We get the path by getting the system property with the // defined key above. String path = System.getProperty(userHome); // […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API09 Sep 2006

How do I get operating system name and version?

package org.kodejava.lang; public class OperatingSystemInfo { public static void main(String[] args) { // The key for getting operating system name String name = "os.name"; // The key for getting operating system version String version = "os.version"; // The key for getting operating system architecture String architecture = "os.arch"; System.out.println("Name : " + System.getProperty(name)); System.out.println("Version: " […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API07 Sep 2006

How do I add a delay in my program?

You have a problem that you want to add a delay for a couple of seconds in your program. Using Thread.sleep() method we can add delay in our application in a millisecond time. The Thread.sleep() need to be executed inside a try-catch block, and we need to catch the InterruptedException. Let’s see the code snippet […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API05 Sep 2006

How do I get a part or a substring of a string?

The following code snippet demonstrates how to get some part from a string. To do this we use the String.substring() method. The first substring() method take a single parameter, beginIndex, the index where substring start. This method will return part of string from the beginning index to the end of the string. The second method, […]

Wayan · 2 min read
BASIC / NOTES</>↗
Basic02 Sep 2006

How do I get the command line arguments passed to the program?

When we create a Java application we might want to pass a couple of parameters to our program. To get the parameters passed from the command line we can read it from the main(String[] args) method arguments. To make a class executable we need to create a main() method with the following signatures: public static […]

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.