Wednesday, 22 May 2019

Java: Get default charset or encoding of JVM


'Charset.defaultCharset()' method returns the default charset of this Java virtual machine.

App.java
package com.sample.app;

import java.nio.charset.Charset;

public class App {

 public static void main(String args[]) {
  System.out.println(Charset.defaultCharset());
 }
}

Output
UTF-8


You may like

No comments:

Post a Comment