FileDocCategorySizeDatePackage
SetLocale.javaAPI DocExample631Fri Mar 30 10:21:50 BST 2001None

SetLocale

public class SetLocale extends Object
Change the default locale

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)


		switch (args.length) {
		case 0:
			Locale.setDefault(Locale.FRANCE);
			break;
		case 1:
			throw new IllegalArgumentException();
		case 2:
			Locale.setDefault(new Locale(args[0], args[1]));
			break;
		default:
			System.out.println("Usage: SetLocale [language [country]]");
			// FALLTHROUGH
		}

		DateFormat df = DateFormat.getInstance();
		NumberFormat nf = NumberFormat.getInstance();

		System.out.println(df.format(new Date()));
		System.out.println(nf.format(123.4567));