URLConnection getDefaultAllowUserInteraction Example
URLConnection class getDefaultAllowUserInteraction example. This example shows you how to use getDefaultAllowUserInteraction method.
URLConnection class getDefaultAllowUserInteraction example. public static boolean getDefaultAllowUserInteraction() Returns the default value of the allowUserInteraction field. Ths default is "sticky", being a part of the static state of all URLConnections. This flag applies to the next, and all following URLConnections that are created.
Here is the code
/*
* @ # GetDefaultAllowUserInteraction.java
* A class repersenting use to GetDefaultAllowUserInteraction
* method of URLConnection class in java.net package
* version 23 June 2008
* author Rose India
*/
import java.net.*;
public class GetDefaultAllowUserInteraction {
public static void main(String args[]) throws Exception {
SocketAddress socketAddress = new InetSocketAddress("192.168.10.80", 9090);
Proxy proxy = new Proxy(Proxy.Type.HTTP, socketAddress);
URL url = new URL("http://google.com");
URLConnection connection = url.openConnection(proxy);
System.out.println("DefaultAllowUserInteraction " +
connection.getDefaultAllowUserInteraction());
}
} |
Output
| DefaultAllowUserInteraction false |
|