Java IO Tutorial - Java Charset.contains(Charset cs)


Charset.contains(Charset cs) has the following syntax.

public abstract boolean contains(Charset cs)


In the following code shows how to use Charset.contains(Charset cs) method.

import java.nio.charset.Charset;
// w w  w  .  j a  v a  2 s .c o m
public class Main {

  public static void main(String[] args) {
    Charset csets = Charset.forName("UTF16");
    Charset csets1 = Charset.forName("UTF-8");


The code above generates the following result.