wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Locale Class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Locale Class" Watch "Locale Class" New topic
Author

Locale Class

Jitendra Jha
Ranch Hand

Joined: Jan 28, 2007
Posts: 91
I was trying to work through this code

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

class LocaleC
{

public static void main(String[] srt)
{
Calendar cc=Calendar.getInstance();
cc.set(1998,04,19);
Date d=cc.getTime();
System.out.println(d);

Locale lc=new Locale("it","IT");
DateFormat df=DateFormat.getDateInstance(DateFormat.FULL,lc);
String s=df.format(d);
System.out.println(d);

}
}



this code is supposed to give me locale specific information about Italy which it does not.
I am unable to figure out my mistake.Please help

Jitendra


Jitendra
SCJP1.5
SCWCD1.5
Jitendra Jha
Ranch Hand

Joined: Jan 28, 2007
Posts: 91
Sorry, i figured out my mistake
It was the wrong print statement on the last line.
I should have passed s instead of d
Sorry again to have wasted your precious time

Jitendra
 
wood burning stoves
 
subject: Locale Class
 
Similar Threads
Referring a Local Inner Class
java.util.Locale will accept any String...
LOCAL CLASS
Calendar with Locale
question about locale