CORE API / CATATAN</>↗Core API15 Apr 2008
This example shows how we can change the date formatting symbols. In this example we change the month names and short month names and also the weekday names and short weekday names. Other than these two items we can also change other symbols such as the Era name and AM-PM string. package org.kodejava.text; import java.text.SimpleDateFormat; […]
BASIC / CATATAN</>↗Basic15 Apr 2008
package org.kodejava.lang; public class XorDemo { public static void main(String[] args) { int numberA = 16; int numberB = 32; // Operator ^ is used for doing bitwise exclusive OR operation int result = numberA ^ numberB; System.out.println(numberA + " ^ " + numberB + " = " + result); // Print the result in […]
BASIC / CATATAN</>↗Basic13 Apr 2008
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 […]
BASIC / CATATAN</>↗Basic10 Apr 2008
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 […]
BEANS / CATATAN</>↗Beans09 Apr 2008
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 […]
CORE API / CATATAN</>↗Core API06 Apr 2008
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...