BASIC / NOTES</>↗Basic10 Dec 2007
Here are the summary of the available keywords in the Java programming language. Keywords are reserved words that already taken and internally used by Java, so we cannot create variables and name it using this keyword. Keyword Meaning abstract an abstract class or method assert used to locate internal program errors boolean the Boolean type […]
JDOM / NOTES</>↗JDOM06 Dec 2007
This example provide a small code snippet on how to use JDOM to parse an XML document, iterates each of the element and read the element or attributes values. To play with this example you have to have the JDOM library. You can download it from JDOM website. package org.kodejava.jdom; import org.jdom2.Document; import org.jdom2.Element; import […]
CORE API / NOTES</>↗Core API02 Dec 2007
This example shows you how we can sort items of an ArrayList using the Collections.sort() method. Beside accepting the list object to be sorted we can also pass a Comparator implementation to define the sorting behaviour such as sorting in descending or ascending order. package org.kodejava.util; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; public […]
CORE API / NOTES</>↗Core API28 Nov 2007
By default, when sorting an arrays the value will be ordered in case-sensitive order. This example show you how to order it in case-insensitive order. package org.kodejava.util; import java.util.Arrays; public class SortArrayCaseSensitivity { public static void main(String[] args) { String[] teams = new String[5]; teams[0] = "Manchester United"; teams[1] = "chelsea"; teams[2] = "Arsenal"; teams[3] […]
CORE API / NOTES</>↗Core API23 Nov 2007
Here you will find an example on how to sort the values of an array in ascending or descending order. package org.kodejava.util; import java.util.Arrays; import java.util.Collections; public class SortArrayWithOrder { public static void main(String[] args) { Integer[] points = new Integer[5]; points[0] = 94; points[1] = 53; points[2] = 70; points[3] = 44; points[4] = […]
HIBERNATE / NOTES</>↗Hibernate23 Nov 2007
In the example below you’ll see how to limit the number of records returned by hibernate queries. Limiting the query result is usually use for creating pagination, where we can navigate from page to page of data in our application but only a few of them are read from the database. In hibernate Query object […]