Archives:

Java – Enum Example


Java – Get Country List

The Locale.getISOCountries() will return a list of all 2-letter country codes defined in ISO 3166

Output:

Country Code = AD, Country Name = Andorra
Country Code = AE, Country Name = United Arab Emirates
Country Code = AF, Country Name = Afghanistan
Country Code = AG, Country Name = Antigua and Barbuda
Country Code = AI, Country Name = Anguilla
Country Code = AL, Country Name = Albania
//skip ……

Java – Convert java.util.Date to JodaTime

Make sure date isn’t null, though, otherwise it acts like new new DateTime()