CORE API / NOTES</>↗Core API06 Jun 2006
The example code below helps you to get all weekday names as an array of string. The first method, getWeekdays() return the full name string while the second method getShortWeekdays() return the short name of the weekday. package org.kodejava.text; import java.text.DateFormatSymbols; public class WeekdayNames { public static void main(String[] args) { DateFormatSymbols dfs = new […]
CORE API / NOTES</>↗Core API05 Jun 2006
The example code below helps you to get all month names as an array of String. The first method, getMonths() return the full name string while the second method getShortMonths() return the short name of the month. package org.kodejava.text; import java.text.DateFormatSymbols; import java.util.Locale; public class MonthNames { public static void main(String[] args) { String[] months […]
CORE API / NOTES</>↗Core API02 Jun 2006
The following code snippet demonstrate how to use the Boolean.valueOf() method to convert primitive boolean value or a string into Boolean object. This method will return the corresponding Boolean object of the given primitive boolean value. When a string value is passed to this method it will return Boolean.TRUE when the string is not null, […]
CORE API / NOTES</>↗Core API29 May 2006
To convert a string into boolean we can use the Boolean.parseBoolean(String) method. If we pass a non null value that equals to true, ignoring case, this method will return true value. Given other values it will return a false boolean value. package org.kodejava.lang; public class BooleanParseExample { public static void main(String[] args) { // Parsing […]
CORE API / NOTES</>↗Core API28 May 2006
In this example you will see how to delete a file in Java. To delete a file we start by creating a File object that represent the file to be deleted. We use the exists() method to check if the file is exists before we try to delete it. To delete the file we call […]
CORE API / NOTES</>↗Core API25 May 2006
The example here show you how to get an IP or host address using the java.net.InetAddress class. To get an instance of InetAddress we call a static method of this class, the method is getLocalHost(), which return the local host address. Next, to get the IP address we can call the getHostAddress() method. package org.kodejava.net; […]