• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Locale Class

 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 Jha
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic