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.

JAVA 8 / CATATAN</>
Java 817 Jan 2024

How do I use plus and minus method in the Java Date-Time API?

In the Java Date-Time API, the plus and minus methods can be used to calculate and modify dates, times, date/times, and durations. Each temporal class (LocalDate, LocalTime, LocalDateTime, and Duration) includes these methods. Here’s a basic example using the LocalDate class: package org.kodejava.datetime; import java.time.LocalDate; public class PlusMinusExample { public static void main(String[] args) { […]

Wayan · 4 menit baca
JAVA 8 / CATATAN</>
Java 815 Jan 2024

How do I use atDate() method of Java Date-Time API?

The atDate() method is a part of LocalTime class in the Java Date-Time API. This method combines this time with a date to create an instance of LocalDateTime. Here’s an example: package org.kodejava.datetime; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; public class AtDateExample { public static void main(String[] args) { // Create a LocalTime instance LocalTime […]

Wayan · 1 menit baca
JAVA DATE TIME API / CATATAN</>
Java Date Time API15 Jan 2024

How do I use atTime() method of Java Date-Time API?

The atTime() method belongs to the LocalDate class in the Java Date-Time API, not the Date class. This method combines this date with a time to create a LocalDateTime. Here’s an example: package org.kodejava.datetime; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; public class AtTimeExample { public static void main(String[] args) { // Create a LocalDate instance […]

Wayan · 2 menit baca
JAVA 8 / CATATAN</>
Java 814 Jan 2024

How do I use map() method of Optional object?

The map method of the Optional class in Java is used to transform the value contained in the Optional. map allows you to apply a function on the value inside the Optional and returns an Optional that contains the result of the function. Here is an example of how to use it: package org.kodejava.util; import […]

Wayan · 2 menit baca
JAVA 8 / CATATAN</>
Java 814 Jan 2024

How do I use flatMap() method of Optional object?

The flatMap method is a special method in the Optional class in Java, if a method returns an Optional, you can use flatMap to avoid nested Optional<Optional<T>> situations. Here is an example: package org.kodejava.util; import java.util.Optional; public class OptionalFlatMap { public static void main(String[] args) { Optional<String> nonEmptyGender = Optional.of("male"); Optional<String> emptyGender = Optional.empty(); System.out.println("Non-Empty […]

Wayan · 2 menit baca
JAVA 8 / CATATAN</>
Java 814 Jan 2024

How do I use filter() method of Optional object?

The java.util.Optional class in Java provides a filter method. It’s used to apply a condition on the value held by this Optional. Here is an example of how to use Optional‘s filter method: package org.kodejava.util; import java.util.Optional; public class OptionalFilter { public static void main(String[] args) { // Creating Optional object and assigning a value […]

Wayan · 2 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.