URL getAuthority Example
URL class getAuthority example. This example shows you how to use getAuthority method.
URL class getAuthority example. public String getAuthority() Gets the authority part of this URL.
Here is the code
/*
* @ # GetAuthority.java
* A class repersenting use to GetAuthority method
* of URL class in java.net package
* version 23 June 2008
* author Rose India
*/
import java.net.*;
public class GetAuthority {
public static void main(String[] args) throws Exception{
URL url = new URL("http://localhost:8080/programs/");
System.out.println(url.getAuthority());
}
} |
|