Java tutorial
//package com.java2s; //License from project: LGPL import java.util.Properties; public class Main { public static int getIntProperty(Properties properties, String key, int defaultValue) { if (properties != null) { String value = properties.getProperty(key, "").trim(); if (!value.equals("")) { try { return Integer.parseInt(value); } catch (NumberFormatException var5) { ; } } } return defaultValue; } }