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.

JDBC / CATATAN</>
JDBC25 Okt 2006

How do I retrieve values from ResultSet?

Here is another example on how to read data from a ResultSet returned by executing an SQL query in a database. We start by creating a connection to the database. Creates a PreparedStatement to execute a query to get some data from the books table. After executing the PreparedStatement we will have a ResultSet object. […]

Wayan · 2 menit baca
CORE API / CATATAN</>
Core API21 Okt 2006

How do I know the minimum and maximum number in an array?

package org.kodejava.util; import java.util.Arrays; import java.util.Collections; public class ArrayMinMax { public static void main(String[] args) { // Creates an array of integer numbers in it. Integer[] numbers = {8, 2, 6, 7, 0, 1, 4, 9, 5, 3}; // To get the minimum or maximum value from the array we can // use the Collections.min() […]

Wayan · 1 menit baca
CORE API / CATATAN</>
Core API20 Okt 2006

How can I change file attribute to writable?

Prior to Java 1.6 the java.io.File class doesn’t include a method to change a read only file attribute and make it writable. To do this on the old days we have to utilize or called operating system specific command. In Java 1.6 a new method named setWritable() was introduced to do exactly what the method […]

Wayan · 2 menit baca
CORE API / CATATAN</>
Core API19 Okt 2006

How can I change file attribute to read only?

This code demonstrate how we can modify file attribute to be read only. File class has a setReadOnly() method to make file read only and a canWrite() method to know whether it is writable or not. package org.kodejava.io; import java.io.File; public class FileReadOnlyExample { public static void main(String[] args) throws Exception { File file = […]

Wayan · 1 menit baca
CORE API / CATATAN</>
Core API14 Okt 2006

How do I know the memory size in virtual machine?

If you want to know the free memory, and the total memory available in the Java runtime environment then you can use the following code snippet to check. package org.kodejava.lang; public class MemoryExample { public static void main(String[] args) { long freeMemory = Runtime.getRuntime().freeMemory(); long totalMemory = Runtime.getRuntime().totalMemory(); System.out.println("Free Memory = " + freeMemory); System.out.println("Total […]

Wayan · 1 menit baca
CORE API / CATATAN</>
Core API14 Okt 2006

How do I ping a host?

Since Java 1.5 (Tiger) the java.net.InetAddress class introduces isReachable() method that can be used to ping or check if the address specified by the InetAddress is reachable. package org.kodejava.net; import java.net.InetAddress; public class PingExample { public static void main(String[] args) { try { InetAddress address = InetAddress.getByName("172.16.2.0"); // Try to reach the specified address within […]

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.