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 Jun 2010

How do I read java.util.Vector object using java.util.Enumeration?

The following code snippets show you how to iterate and read java.util.Vector elements using the java.util.Enumeration. package org.kodejava.util; import java.util.Enumeration; import java.util.Vector; public class VectorEnumeration { public static void main(String[] args) { Vector<String> data = new Vector<>(); data.add("one"); data.add("two"); data.add("three"); StringBuilder sb = new StringBuilder("Data: "); // Iterates vector object to read it elements for […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API19 Jun 2010

How do I remove the first or the last found element from Deque?

This example demonstrates the use of Deque.removeFirstOccurrence() method call to remove the first occurrences of an element in the Deque object and Deque.removeLastOccurrence() method call to remove the last occurrences of an element in the Deque object. package org.kodejava.util; import java.util.Deque; import java.util.Iterator; import java.util.LinkedList; public class DequeRemoveDemo { public static void main(String[] args) { […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API17 Jun 2010

How do I create a Last-In-First-Out Deque?

This example show you how to create a LIFO (Last In First Out) Deque. We call the Deque.peekLast() method to get the last element from the Deque, poll the last element and repeat until all the elements read. package org.kodejava.util; import java.util.Deque; import java.util.LinkedList; public class DequeLifoDemo { public static void main(String[] args) { // […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API16 Jun 2010

How do I get Host Default Time Zone ID?

package org.kodejava.util; import java.util.TimeZone; public class HostDefaultTimeZone { public static void main(String[] args) { // Gets the default TimeZone ID for this host String id = TimeZone.getDefault().getID(); System.out.println("Default Time Zone ID: " + id); } } The default timezone id for this host is: Default Time Zone ID: Asia/Shanghai

Wayan · 1 min read
CORE API / NOTES</>↗
Core API15 Jun 2010

How do I get timezone ids by their milliseconds offset?

package org.kodejava.util; import java.util.TimeZone; public class TimeZoneByOffset { public static void main(String[] args) { // Gets the available IDs according to the given time zone // offset in milliseconds. int offset = 8 * 60 * 60 * 1000; String[] timezones = TimeZone.getAvailableIDs(offset); System.out.println("List of available IDs for GMT:+08:00"); System.out.println("===================================="); for (String id : timezones) […]

Wayan · 1 min read
JDBC / NOTES</>↗
JDBC15 Jun 2010

How do I retrieve available catalogs in database?

The examples below show you how to get the available catalog names in MySQL database. The available catalog names can be obtained from the DatabaseMetaData object by calling the getCatalogs() method. This method returns a ResultSet object. We iterate it and get the schema name by calling the getString() method and pass TABLE_CAT as the […]

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.