Java URI.create(String str)

Syntax

URI.create(String str) has the following syntax.

public static URI create(String str)

Example

In the following code shows how to use URI.create(String str) method.


// w  w  w.j  a  va 2s  .c  o m
import java.net.URI;


public class Main {

  public static void main(String[] args) {
    URI uri = URI.create("http://java2s.com");
    System.out.println(uri);
  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    java.net »




CookieManager
CookiePolicy
CookieStore
DatagramPacket
DatagramSocket
HttpCookie
HttpURLConnection
InetAddress
JarURLConnection
MulticastSocket
ServerSocket
Socket
SocketAddress
URI
URL
URLConnection
URLDecoder
URLEncoder