Setting the default Locale in Java

Use Locale.setDefault.

Main.java:

import java.util.*;
 
public class Main {
   public static void main(String []args) {
      // for default locale 
      Locale locale = Locale.getDefault();
      System.out.println(locale);  
 
      Locale.setDefault(new Locale("nl", "BE")); 
      locale = Locale.getDefault();
      System.out.println(locale);  
   }
}

outputs:

en_US
nl_BE