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 API05 Sep 2006

How do I get a part or a substring of a string?

The following code snippet demonstrates how to get some part from a string. To do this we use the String.substring() method. The first substring() method take a single parameter, beginIndex, the index where substring start. This method will return part of string from the beginning index to the end of the string. The second method, […]

Wayan · 2 menit baca
BASIC / CATATAN</>
Basic02 Sep 2006

How do I get the command line arguments passed to the program?

When we create a Java application we might want to pass a couple of parameters to our program. To get the parameters passed from the command line we can read it from the main(String[] args) method arguments. To make a class executable we need to create a main() method with the following signatures: public static […]

Wayan · 2 menit baca
CORE API / CATATAN</>
Core API01 Sep 2006

How do I get operating system temporary directory / folder?

To get the location of temporary directory we can use the System.getProperty(String) method and pass a property key "java.io.tmpdir" as the argument to the method. package org.kodejava.lang; public class TempDirExample { public static void main(String[] args) { // This is the property name for accessing OS temporary directory // or folder. String property = "java.io.tmpdir"; […]

Wayan · 1 menit baca
APACHE COMMONS / CATATAN</>
Apache Commons28 Agt 2006

How do I create a copy of a file?

This example shows how we can use the Apache Commons IO library to simplify a file copy process. package org.kodejava.commons.io; import org.apache.commons.io.FileUtils; import java.io.File; import java.io.IOException; public class FileCopyExample { public static void main(String[] args) { // The source file name to be copied. File source = new File("README.md"); // The target file name to […]

Wayan · 2 menit baca
CORE API / CATATAN</>
Core API26 Agt 2006

How do I convert day-of-year to day-of-month?

package org.kodejava.util; import java.util.Calendar; public class DayYearToDayMonth { public static void main(String[] args) { // Create an instance of calendar for the year 2017 and set the // day to the 180 day of the year. Calendar cal = Calendar.getInstance(); cal.set(Calendar.YEAR, 2021); cal.set(Calendar.DAY_OF_YEAR, 180); // Print the date of the calendar. System.out.println("Calendar date is: " […]

Wayan · 2 menit baca
CORE API / CATATAN</>
Core API22 Agt 2006

How do I check if a year is a leap year?

The following example using the GregorianCalendar.isLeapYear() method to check if the specified year is a leap year. package org.kodejava.util; import java.util.GregorianCalendar; public class LeapYearExample { public static void main(String[] args) { // Here we show how to know if a specified year is a leap year or // not. The GregorianCalendar object provide a convenient […]

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.