Test.java Source code

Java tutorial

Introduction

Here is the source code for Test.java

Source

import java.text.DateFormat;
import java.util.Calendar;
import java.util.Locale;

public class Test {

    public static void main(String[] args) {
        Locale locale = Locale.getDefault();
        Calendar calendar = Calendar.getInstance();
        calendar.setWeekDate(2012, 16, 3);

        System.out.println(
                DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG).format(calendar.getTime()));
        System.out.println("" + locale.getDisplayLanguage());

        Locale.setDefault(Locale.Category.FORMAT, Locale.JAPANESE);
        Locale.setDefault(Locale.Category.DISPLAY, Locale.GERMAN);

        System.out.println(
                DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG).format(calendar.getTime()));
        System.out.println("" + locale.getDisplayLanguage());

    }
}