SupportWriter space ↗
REFERENCE LIBRARY

References from other publishers

Republished articles with source attribution. This collection is separate from Diary Coding’s original guides and does not display ads.

Read original guides → · Editorial policy

FOR YOUR CURIOSITY

Latest notes.

BASIC / NOTES</>↗
Basic25 Sep 2009

How do I use the continue statement?

The continue statement has two forms, the unlabeled and labeled continue statement. The first example shows you how to use the unlabeled continue statement while the second example shows you how to use the labeled continue statement. package org.kodejava.basic; public class ContinueDemo { public static void main(String[] args) { int[] numbers = {5, 11, 3, […]

Wayan · 1 min read
BASIC / NOTES</>↗
Basic23 Sep 2009

How do I use the break statement?

The break statement has two forms, the unlabeled and labeled break. On the example below you see the first example as the unlabeled break. This type of break statement will terminate the innermost loop such as the for, while and do-while loop. On the second example you’ll see the labeled break. We have two loops, […]

Wayan · 2 min read
BASIC / NOTES</>↗
Basic21 Sep 2009

How do I use the for loop statement?

The for loop can be used to iterate over a range of values. For instance if you want to iterate from 0 to 10 or if you want to iterate through all the items of an array. Below you’ll see two forms of a for loop. The first one is the general form of a […]

Wayan · 2 min read
BASIC / NOTES</>↗
Basic21 Sep 2009

How do I use the do-while loop statement?

There is also a do-while loop in the Java programming language. Instead of evaluating the expression at the beginning like the while loop does the do-while loop evaluates its expression at the end of the loop. Due to this the loop executes at least once during the program execution. package org.kodejava.basic; public class DoWhileDemo { […]

Wayan · 1 min read
BASIC / NOTES</>↗
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 min read
BASIC / NOTES</>↗
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 min read
✳

Knowledge grows when shared.

Stay curious. There is always something new to learn.

Explore notes ↗
Putu Adi Guna Permana
ABOUT THE AUTHOR

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Writer and founder of Diary Coding — sharing notes, tutorials, and experiences about programming for anyone who wants to keep learning.