URL getPath Example
URL class getPath example. This example shows you how to use getPath method.
URL class getPath example. public String getPath() Gets the path part of this URL.
Here is the code
/*
* @ # GetPath.java
* A class repersenting use to getPath method
* of URL class in java.net package
* version 24 June 2008
* author Rose India
*/
import java.net.*;
public class GetPath {
public static void main(String args[]) throws Exception {
URL url = new URL("http://java.sun.com/javase/6/docs/api/");
System.out.println(url.getPath());
}
} |
|