Java tutorial
//package com.java2s; public class Main { public static int binaryToTen(String paramString) { if ((paramString == null) || ((paramString != null) && ("".equals(paramString)))) { return 0; } return Integer.valueOf(paramString, 2).intValue(); } }