SupportWriter space ↗
A JOURNAL ABOUT TECHNOLOGY

Learn something new.
Write. Share.

A space to connect knowledge, one line of code a day.
Discover tutorials, ideas, and notes from a learning journey.

1967 notes & counting ↙
EDITOR’S PICK ↗
Pentesting

Planning Your First Web Application Pentest: Scope, Safety, and Evidence

Build a focused web pentest plan with clear authorization, realistic objectives, controlled testing, and evidence that developers can use.

D Putu Adi Guna Permana · 3 min read
FOR YOUR CURIOSITY

Latest notes.

CORE API / NOTES</>↗
Core API11 Apr 2007

How do I know the class of an object?

For instance, you have a collection of objects in an List object, and you want to do some logic based on the object’s class. This can easily be done using the instanceof operator. The operator returns true if an object is an instance of a specified class, if not it will return false. The instanceof […]

Wayan · 2 min read
APPLET / NOTES</>↗
Applet07 Apr 2007

How do I change an applet background color?

By default, the applet will usually have a grey background when displayed in a web browser. If you want to change it then you can call the setBackground(java.awt.Color) method and choose the color you want. Defining the background color in the init() method will change the color as soon as the applet initialized. package org.kodejava.applet; […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API05 Apr 2007

How do I replace characters in string?

package org.kodejava.lang; public class StringReplace { public static void main(String[] args) { String text = "The quick brown fox jumps over the lazy dog"; System.out.println("Before: " + text); // The replace method replace all occurrences of character // 'o' with 'u' and returns a new string object. text = text.replace('o', 'u'); System.out.println("After : " + […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API03 Apr 2007

How do I copy char array to string?

package org.kodejava.lang; public class CharArrayCopyExample { public static void main(String[] args) { char[] data = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'}; // Copy all value in the char array and create a new string out of it. String text = String.valueOf(data); System.out.println(text); // Copy a sub array from the char array […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API02 Apr 2007

How do I remove leading and trailing white space from string?

package org.kodejava.lang; public class TrimStringExample { public static void main(String[] args) { String text = " tattarrattat "; System.out.println("Original = " + text); System.out.println("text.length() = " + text.length()); // The trim() method will result a new string object with a leading and // trailing while space removed. text = text.trim(); System.out.println("Result = " + text); […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API29 Mar 2007

How do I format a number with leading zeros?

This example give you an example using java.text.DecimalFormat class to add leading zeros to a number. For another method you can read the see the earlier example on How do I add leading zeros to a number?. package org.kodejava.text; import java.text.DecimalFormat; import java.text.NumberFormat; public class NumberFormatLeadingZerosExample { public static void main(String[] args) { NumberFormat formatter […]

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