Ruang penulis
SEBUAH JURNAL TENTANG TEKNOLOGI

Belajar hal baru.
Tulis. Bagikan.

Ruang untuk merangkai pengetahuan, satu baris kode setiap hari.
Temukan tutorial, ide, dan catatan dari perjalanan belajar.

1914 catatan & terus bertumbuh
PILIHAN EDITOR
Java

Memahami Java Stream: olah koleksi dengan lebih ringkas

Pelajari alur filter, map, dan collect untuk mengolah data Java dengan kode yang mudah dibaca.

D Tim Diary Coding · 1 menit baca
UNTUK RASA INGIN TAHUMU

Catatan terbaru.

CORE API / CATATAN</>
Core API18 Sep 2008

How do I search collection elements?

This code example use the Collections.binarySearch() to search an specified object inside a specified collections. Prior to calling the binarySearch() method we need to sort the elements of the collection. If the object is not sorted according to their natural order the search result will be undefined. package org.kodejava.util; import java.util.Arrays; import java.util.LinkedList; import java.util.Collections; […]

Wayan · 1 menit baca
CORE API / CATATAN</>
Core API15 Sep 2008

How do I rotate elements of a collection?

This example demonstrate how to rotate the elements of a collection object. We can use the java.util.Collections class and call the rotate() method with the collection to rotate and the distance as the parameters. package org.kodejava.util; import java.util.List; import java.util.ArrayList; import java.util.Collections; import java.util.Arrays; public class CollectionRotate { public static void main(String[] args) { List<Integer> […]

Wayan · 1 menit baca
CORE API / CATATAN</>
Core API13 Sep 2008

How do I display file contents in hexadecimal?

In this program we read the file contents byte by byte and then print the value in hexadecimal format. As an alternative to read a single byte we can read the file contents into array of bytes at once to process the file faster. package org.kodejava.io; import java.io.FileInputStream; public class HexDumpDemo { public static void […]

Wayan · 1 menit baca
SWING / CATATAN</>
Swing11 Sep 2008

How do I use SwingWorker to perform background tasks?

This demo gives examples of using the SwingWorker class. The purpose of SwingWorker is to implement a background thread that you can use to perform time-consuming operations without affecting the performance of your program’s GUI. package org.kodejava.swing; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.SwingUtilities; import javax.swing.SwingWorker; import javax.swing.WindowConstants; import java.awt.Dimension; impo...

Wayan · 2 menit baca
CORE API / CATATAN</>
Core API11 Sep 2008

How do I know if a date is after another date?

This example demonstrate Date‘s class after() method to check if a date is later than another date. package org.kodejava.util; import java.util.Date; import java.util.Calendar; public class DateCompareAfter { public static void main(String[] args) { // Get current date Date today = new Date(); // Add 1 day from the current date. Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.DATE, […]

Wayan · 1 menit baca
CORE API / CATATAN</>
Core API10 Sep 2008

How do I know if a date is before another date?

This example demonstrate Date‘s class before() method to check if a date is earlier than another date. package org.kodejava.util; import java.util.Date; import java.util.Calendar; public class DateCompareBefore { public static void main(String[] args) { // Get current date Date today = new Date(); // Subtract 1 day from the current date. Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.DATE, […]

Wayan · 1 menit baca

Pengetahuan tumbuh ketika dibagikan.

Simpan rasa ingin tahu. Selalu ada hal baru untuk dipelajari.

Jelajahi catatan ↗
Putu Adi Guna Permana
TENTANG PENULIS

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Penulis dan pendiri Diary Coding — berbagi catatan, tutorial, dan pengalaman seputar pemrograman untuk siapa pun yang ingin terus belajar.