URLConnection getUseCaches Example
URLConnection class getUseCaches example. This example shows you how to use getUseCaches method.
URLConnection class getUseCaches example. public boolean getUseCaches() Returns the value of this URLConnection's useCaches field.
Here is the code
/*
* @ # GetUseCaches.java
* A class repersenting use to GetUseCaches method
* of URL class in java.net package
* version 24 June 2008
* author Rose India
*/
import java.net.*;
public class GetUseCaches {
public static void main(String args[]) throws Exception {
SocketAddress address = new InetSocketAddress("192.168.10.80", 9090);
Proxy proxy = new Proxy(Proxy.Type.HTTP, address);
URL url = new URL("http://google.com");
URLConnection connection = url.openConnection(proxy);
System.out.println("Use Caches " + connection.getUseCaches());
}
} |
|