URLConnection.getHeaderFieldInt(String name, int Default) has the following syntax.
public int getHeaderFieldInt(String name, int Default)
In the following code shows how to use URLConnection.getHeaderFieldInt(String name, int Default) method.
import java.net.URL; import java.net.URLConnection; // w w w. j a v a2s. c o m public class Main{ public static void main(String args[]) throws Exception { URL url = new URL("http://www.google.com"); URLConnection httpCon = (URLConnection) url.openConnection(); int s = httpCon.getHeaderFieldInt("intKey", 1); } }