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 Agt 2006

How do I calculate difference in days between two dates?

In the following example we are going to calculate the differences between two dates. First, we will need to convert the date into the corresponding value in milliseconds and then do the math, so we can get the difference in days, hours, minutes, etc. For example to get the difference in day we will need […]

Wayan · 2 menit baca
APACHE COMMONS / CATATAN</>
Apache Commons13 Agt 2006

How do I count word occurrences in a string?

package org.kodejava.commons.lang; import org.apache.commons.lang3.StringUtils; public class WordCountDemo { public static void main(String[] args) { // We have the source text we'll do the search on. String source = "From the download page, you can download the Java " + "Tutorials for browsing offline. Or you can just download " + "the example."; // The word […]

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

How do I reverse a string, words or sentences?

package org.kodejava.commons.lang; import org.apache.commons.lang3.StringUtils; public class StringReverseDemo { public static void main(String[] args) { // We have an original string here that we'll need to reverse. String words = "The quick brown fox jumps over the lazy dog"; // Using StringUtils.reverse we can reverse the string letter by letter. String reversed = StringUtils.reverse(words); // Now […]

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

How do I check if a string is empty or not?

package org.kodejava.commons.lang; import org.apache.commons.lang3.StringUtils; public class EmptyStringCheckDemo { public static void main(String[] args) { // Create some variable to hold some empty string, contains only // whitespaces and words. String one = ""; String two = "\t\r\n"; String three = " "; String four = null; String five = "four four two"; // We can […]

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

How do I convert Date to String?

package org.kodejava.text; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.Calendar; import java.util.Date; public class DateToString { public static void main(String[] args) { // Create an instance of SimpleDateFormat used for formatting // the string representation of date (day/month/year) String pattern = "dd/MM/yyyy"; DateFormat df = new SimpleDateFormat(pattern); // Ge...

Wayan · 1 menit baca
CORE API / CATATAN</>
Core API30 Jul 2006

How do I get day of week?

In this example we want to create a calendar or date from a year and day of the year. Next we will find out what day-of-week that calendar or date represent. In the code snippet below we are trying to find the 180 day of the year 2021. Let’s see the example below. package org.kodejava.util; […]

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.