XML / NOTES</>↗XML18 Dec 2015
The javax.xml.validation package provides an API for XML documents validation. The validation process verify that an XML document is an instance of a specified XML schema file or XSD file. In this example we are going to validate if the records.xml file below ins an instance of the records.xsd schema. First we will create the […]
JAVA 8 / NOTES</>↗Java 815 Nov 2015
The java.time.DayOfWeek enums in Java 8 Date-Time API describes the days of the week. The enum has constants value from DayOfWeek.MONDAY through DayOfWeek.SUNDAY. These enums also have their integer values where 1 is equal to MONDAY and 7 is equal to SUNDAY. In the code snippet below you can see a couple usage of the […]
JAVA 8 / NOTES</>↗Java 815 Nov 2015
In your Java application you want to format date-time objects using the new date and time API introduced in JDK 8. A solution to this problem is to use the java.time.format.DateTimeFormatter. The DateTimeFormatter class provides formatter for printing and parsing date-time objects. With this class we can format the date-time objects using a predefined constants, […]
CORE API / NOTES</>↗Core API19 Jul 2015
As we know an array in Java is a fixed-size object, once it created its size cannot be changed. So if you want to have a resizable array-like object where you can insert an element at a given position you can use a java.util.List object type instead. This example will show you how you can […]
TOOLS / NOTES</>↗Tools19 Jul 2015
The easiest way to install Oracle Java (JDK) in Ubuntu is to use the WebUpd8 PPA. A PPA (Personal Package Archive) is a special software repository for uploading source packages to be build and published as an APT repository by Launchpad. This PPA will download the required files from Oracle and install JDK7 / JDK8 […]
JAVA 8 / NOTES</>↗Java 818 Jul 2015
The following example show you how to get the length of a month represented by a java.time.LocalDate and a java.time.YearMonth objects. Both of these classes have a method called lengthOfMonth() that returns the length of month in days represented by those date objects. package org.kodejava.datetime; import java.time.LocalDate; import java.time.Month; import java.time.YearMonth; public class LengthOfMonth { […]