URL toExternalForm Example
URL class toExternalForm example. This example shows you how to use toExternalForm method.
URL class toExternalForm example. public String toExternalForm() Constructs a string representation of this URL. The string is created by calling the toExternalForm method of the stream protocol handler for this object.
Here is the code
/*
* @ # ToExternalForm.java
* A class repersenting use to toExternalForm method
* of URL class in java.net package
* version 24 June 2008
* author Rose India
*/
import java.net.*;
public class ToExternalForm {
public static void main(String[] args) throws Exception {
URL url = new URL("http://google.com");
System.out.println(url.toExternalForm());
}
} |
|