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</>↗
Basic13 Apr 2008

How do I do bitwise OR operation?

package org.kodejava.lang; public class OrDemo { public static void main(String[] args) { int numberA = 16; int numberB = 4; // Operator "|" is used for doing bitwise OR operation int result = numberA | numberB; System.out.println(numberA + " | " + numberB + " = " + result); // Print the result in binary […]

Wayan · 1 min read
BASIC / NOTES</>↗
Basic10 Apr 2008

How do I do bitwise AND operation?

package org.kodejava.lang; public class AndDemo { public static void main(String[] args) { int numberA = 16; int numberB = 16; // Operator "&" is used for doing bitwise AND operation int result = numberA & numberB; System.out.println(numberA + " & " + numberB + " = " + result); // Print the result in binary […]

Wayan · 1 min read
BEANS / NOTES</>↗
Beans09 Apr 2008

How do I prevent bean’s property being serialized to XML?

package org.kodejava.bean; import java.beans.*; import java.io.BufferedOutputStream; import java.io.FileOutputStream; import java.io.FileNotFoundException; public class BeanToXmlTransient { private Long id; private String itemName; private String itemColour; private Integer itemQuantities; static { try { // In this block will change the attribute type of the // itemQuantities to transient, so it will be not serialized // to xml when […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API06 Apr 2008

How do I convert LinkedList to array?

package org.kodejava.util; import java.util.LinkedList; import java.util.List; public class LinkedListToArray { public static void main(String[] args) { List<String> list = new LinkedList<>(); list.add("Blue"); list.add("Green"); list.add("Purple"); list.add("Orange"); // Converting LinkedList to array can be done by calling the toArray() // method of the List; String[] colors = new String[list.size()]; list.toArray(colors); for (String color : colors) { System.out.println("c...

Wayan · 1 min read
BEANS / NOTES</>↗
Beans05 Apr 2008

How do I convert an XML persistence to Java Bean?

In the previous example you can see how to convert a bean into an XML persistence. Now we’ll do the opposite, converting the XML back to a bean. For the BeanToXML class use in this example please refer to How do I convert a bean to XML persistence? example. package org.kodejava.bean; import java.beans.XMLDecoder; import java.io.BufferedInputStream; […]

Wayan · 2 min read
BEANS / NOTES</>↗
Beans03 Apr 2008

How do I convert a bean to XML persistence?

package org.kodejava.bean; import java.beans.XMLEncoder; import java.io.BufferedOutputStream; import java.io.FileOutputStream; import java.io.FileNotFoundException; public class BeanToXML { private Long id; private String itemName; private String itemColour; private Integer itemQuantities; public static void main(String[] args) { BeanToXML bean = new BeanToXML(); bean.setId(1L); bean.setItemName("T-Shirt"); bean.setItemColour("Dark Red"); bean.setItemQuantities(100); try { XM...

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.