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 810 Jan 2024

How do I use limit method in Java Stream API?

The limit(long maxSize) method in Java’s Stream API is used for reducing the size of the stream. It takes a single parameter, maxSize, which is a long value that represents the maximum number of elements that the stream should be limited to. The primary purpose and usefulness of the limit() method can be summarized as […]

Wayan · 2 menit baca
SOUND API / CATATAN</>
Sound API10 Jan 2024

Introduction to Java Sound API

The Java Sound API is a feature of the Java platform, designed to provide low-level support for audio operations such as audio playback and capture (recording), audio format conversions, and sequencing and synthesizing of MIDI (Musical Instrument Digital Interface) Overview Java Sound API, included in the Java SE (Standard Edition), is a powerful and flexible […]

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

What is the peek method in Java Stream API and how to use it?

The peek method in Java’s Stream API is an intermediary operation. This method provides a way to inspect the elements in the stream as they’re being processed by other stream operations. However, it’s important to note that peek should only be used for debugging purposes, as it can be quite disruptive to the stream’s data […]

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

How do I use map, filter, reduce in Java Stream API?

The map(), filter(), and reduce() methods are key operations used in Java Stream API which is used for processing collection objects in a functional programming manner. Java Streams provide many powerful methods to perform common operations like map, filter, reduce, etc. These operations can transform and manipulate data in many ways. map: The map() function […]

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

How do I handle exceptions in Stream.forEach() method?

When using Java’s Stream.forEach() method, you might encounter checked exceptions. Checked exceptions can’t be thrown inside a lambda without being caught because of the Consumer functional interface. It does not allow for this in its method signature. Here is an example of how you might deal with an exception in a forEach operation: package org.kodejava.basic; […]

Wayan · 3 menit baca
JAVA 8 / CATATAN</>
Java 809 Jan 2024

How do I loop through streams using forEach() method?

In Java, you can loop through a Stream by using the forEach() method provided by the Stream API. In the following example, we created a Stream of Strings. Each String represents a different programming language. The forEach() method accepts a Consumer, which is a functional interface representing an operation that accepts a single input argument […]

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.