Skip to main content

PLease explian Locale class here in the code

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
No replies
rpolic
Offline
Joined: 2013-06-07
Points: 0

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package JavaFeatures;

import java.text.DateFormat;
import java.util.*;

/**
*
* @author ravirocks
*/
public class In2 {

static void printTime(Locale locale) {

DateFormat d = DateFormat.getTimeInstance(DateFormat.DEFAULT, locale);//Ecplain the line line here
Date currentdate = new Date();
String time = d.format(currentdate);
System.out.println(time + " in locale " + locale);

}

public static void main(String[] args) {
printTime(Locale.FRENCH);
printTime(Locale.US);
printTime(Locale.UK);

}
}