Java IO Tutorial - Java StandardCharsets US_ASCII








Syntax

StandardCharsets.US_ASCII has the following syntax.

public static final Charset US_ASCII

Example

In the following code shows how to use StandardCharsets.US_ASCII field.

/*from w w w .j  av a  2s .  co m*/

import java.nio.charset.StandardCharsets;

public class Main {
  public static void main(String[] args) throws Exception {
    System.out.println(StandardCharsets.US_ASCII.name());
  }

}

The code above generates the following result.