Here you can find the source of TryParse(String str, float defaultFloat)
public static float TryParse(String str, float defaultFloat)
//package com.java2s; public class Main { public static float TryParse(String str, float defaultFloat) { try {/*from w w w. j a v a 2s . c o m*/ float f = Float.parseFloat(str); return f; } catch (NumberFormatException ex) { return defaultFloat; } } }