Java API Tutorial - Java URLConnection .setDefaultAllowUserInteraction (boolean defaultallowuserinteraction)








Syntax

URLConnection.setDefaultAllowUserInteraction(boolean defaultallowuserinteraction) has the following syntax.

public static void setDefaultAllowUserInteraction(boolean defaultallowuserinteraction)

Example

In the following code shows how to use URLConnection.setDefaultAllowUserInteraction(boolean defaultallowuserinteraction) method.

import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
//from www .  j  a v a 2s  .  c  om
public class Main{
  public static void main(String args[]) throws Exception {
    URL url = new URL("http://www.google.com");
    URLConnection httpCon = (URLConnection) url.openConnection();

    URLConnection.setDefaultAllowUserInteraction(true);


 }
}