import java.text.DateFormat;
import java.util.Date;
import java.util.Locale;
public class DefaultLocalSetTest {
public static void main(String[] args) {
Locale currentLocale = Locale.getDefault();
System.out.println("Language: " + currentLocale.getLanguage());
System.out.println("Country:" + currentLocale.getCountry());
DateFormat dateFormat = DateFormat.getDateInstance();
System.out.println(dateFormat.format(new Date()));
Locale.setDefault(new Locale("tr", "TR"));
currentLocale = Locale.getDefault();
System.out.println("Language: " + currentLocale.getLanguage());
System.out.println("Country:" + currentLocale.getCountry());
DateFormat dateFormatTr = DateFormat.getDateInstance();
System.out.println(dateFormatTr.format(new Date()));
}
}
Dosyayı İndir