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.

BASIC / CATATAN</>
Basic19 Sep 2009

How do I use the while loop statement?

The code below demonstrate how to use the while loop statement. The while statement will check if its expression evaluates to true and execute the while statement block. The program below will execute while the countDown value is bigger or equals to zero. package org.kodejava.basic; public class WhileDemo { public static void main(String[] args) { […]

Wayan · 1 menit baca
BASIC / CATATAN</>
Basic19 Sep 2009

How do I use the switch statement?

The program below demonstrate how to use the switch statement. The switch statement can work with the byte, short, int and char primitive data types and the corresponding wrappers of these data type such as Byte, Short, Integer and Character. It also work with enumerated types, refer to the following example: How do I use […]

Wayan · 2 menit baca
BASIC / CATATAN</>
Basic18 Sep 2009

How do I use the if-then-else statement?

The if-then-else control flow statement adds a secondary path to the if statement when the expression evaluates to false. When it evaluates to false the else block will be executed. Below is the program that takes input of user test score and evaluates the score to get the corresponding grade. package org.kodejava.basic; import java.io.Console; public […]

Wayan · 1 menit baca
BASIC / CATATAN</>
Basic17 Sep 2009

How do I use the if-then statement?

The if-then is the most basic control flow statement. It will execute the block of statement only if the test expression evaluated equals to true. Let’s see the example below: package org.kodejava.basic; public class IfThenDemo { public static void main(String[] args) { int a = 10; int b = 5; // If the evaluation of […]

Wayan · 1 menit baca
BASIC / CATATAN</>
Basic15 Sep 2009

How do I count the occurrences of a number in an array?

package org.kodejava.basic; import java.util.HashMap; import java.util.Map; public class NumberOccurrenceInArray { public static void main(String[] args) { int[] numbers = new int[]{1, 8, 3, 4, 3, 2, 5, 7, 3, 1, 4, 5, 6, 4, 3}; Map<Integer, Integer> map = new HashMap<>(); for (int key : numbers) { if (map.containsKey(key)) { int occurrence = map.get(key); occurrence++; […]

Wayan · 1 menit baca
BASIC / CATATAN</>
Basic13 Sep 2009

How do I use the double brace initialization?

The double brace initialization {{ … }} is another way for initializing a collection objects in Java. It is offer a simple syntax for initializing a collection object. package org.kodejava.lang; import java.util.ArrayList; import java.util.List; public class DoubleBraceInitialization { public static void main(String[] args) { // Creates a list of colors and add three colors of […]

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.