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 API30 May 2007

How do I read or download web page content?

You want to create a program that read a webpage content of a website page. The example below use the URL class to create a connection to the website. You create a new URL object and pass the URL information of a page. After the object created you can open a stream connection using the […]

Wayan · 2 min read
APPLET / NOTES</>↗
Applet26 May 2007

How do I display message in browser status bar?

In this applet example you’ll see how to display a message in browser status bar. To make the example a bit more interesting we’ll display the current time as the message. The time will be updated every on second during the lifetime of the applet. package org.kodejava.applet; import java.applet.Applet; import java.awt.Graphics; import java.text.DateFormat; import java.text.SimpleDateFormat; […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API23 May 2007

How do I remove duplicate element from array?

This example demonstrates you how to remove duplicate elements from an array using the help of java.util.HashSet class. package org.kodejava.util; import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Set; public class ArrayRemoveDuplicate { public static void main(String[] args) { // A string array with duplicate values. String[] data = {"A", "C", "B", "D", "A", "B", "E", […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API22 May 2007

How do I convert Array to java.util.Set?

package org.kodejava.util; import java.util.*; public class ArrayToSetExample { public static void main(String[] args) { Integer[] numbers = {7, 7, 8, 9, 10, 8, 8, 9, 6, 5, 4}; // To convert an array into a java.util.Set firstly we need to convert the // array into a java.util.List using the Arrays.asList() method. With the // List […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API19 May 2007

How do I use the HashMap class?

This example demonstrate you how to use the HashMap class to store values in a key-value structure. In this example we store a map of error codes with their corresponding description. To store a value into the map we use the put(key, value) method and to get it back we use the get(key) method. And […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API16 May 2007

How do I generate a random array of numbers?

Using java.util.Random class we can create random data such as boolean, integer, floats, double. First you’ll need to create an instance of the Random class. This class has some next***() methods that can randomly create the data. package org.kodejava.util; import java.util.Arrays; import java.util.Random; public class RandomDemo { public static void main(String[] args) { Random r […]

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.