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 API23 Nov 2007

How do I sort array values in descending order?

Here you will find an example on how to sort the values of an array in ascending or descending order. package org.kodejava.util; import java.util.Arrays; import java.util.Collections; public class SortArrayWithOrder { public static void main(String[] args) { Integer[] points = new Integer[5]; points[0] = 94; points[1] = 53; points[2] = 70; points[3] = 44; points[4] = […]

Wayan · 1 menit baca
HIBERNATE / CATATAN</>
Hibernate23 Nov 2007

How do I limit Hibernate query result?

In the example below you’ll see how to limit the number of records returned by hibernate queries. Limiting the query result is usually use for creating pagination, where we can navigate from page to page of data in our application but only a few of them are read from the database. In hibernate Query object […]

Wayan · 2 menit baca
CORE API / CATATAN</>
Core API18 Nov 2007

How do I store properties as XML file?

In the previous example, How do I load properties from XML file? we read properties from XML file. Now it’s the turn on how to store the properties as XML file. package org.kodejava.io; import java.io.FileOutputStream; import java.nio.charset.StandardCharsets; import java.util.Properties; public class PropertiesToXml { public static void main(String[] args) throws Exception { Properties properties = new […]

Wayan · 2 menit baca
CORE API / CATATAN</>
Core API16 Nov 2007

How do I load properties from XML file?

Reading XML properties can be easily done using the java.util.Properties.loadFromXML() method. Just like reading the properties from a file that contains a key=value pairs, the XML file will also contain a key and value wrapped in the following XML format. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> <properties> <comment>Application Configuration</comment> <entry key="data.folder">D:\AppData</entry> <entry key="...

Wayan · 2 menit baca
CORE API / CATATAN</>
Core API13 Nov 2007

How do I convert InputStream to String?

This example will show you how to convert an InputStream into String. In the code snippet below we read a data.txt file, could be from common directory or from inside a jar file. package org.kodejava.io; import java.io.*; import java.nio.charset.StandardCharsets; public class StreamToString { public static void main(String[] args) throws Exception { StreamToString demo = new […]

Wayan · 2 menit baca
CORE API / CATATAN</>
Core API11 Nov 2007

How do I convert string into InputStream?

Here you will find how to convert string into java.io.InputStream object using java.io.ByteArrayInputStream class. package org.kodejava.io; import java.io.*; import java.nio.charset.StandardCharsets; public class StringToStream { public static void main(String[] args) { String text = "Converting String to InputStream Example"; // Convert String to InputStream using ByteArrayInputStream // class. This class constructor takes the string byte array […]

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.