Java API Tutorial - Java URI.getQuery()








Syntax

URI.getQuery() has the following syntax.

public String getQuery()

Example

In the following code shows how to use URI.getQuery() method.

/*  w  ww .ja va2s  .c  om*/
import java.net.URI;


public class Main {

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

The code above generates the following result.