• 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

need some advise.

 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So I was writing this code today with header info as follows
import java.util.Scanner;
import java.text.*;
import java.util.Locale.*; <- I made a mistake here

I was supposed to do import java.util.Locale; instead, So I wasted alot of time trying to figure out how to get this to work.
The error I kept getting was on the method below I was using somewhere in the code:
NumberFormat nf = NumberFormat .getCurrencyInstance (Locale.US);

error: Cannot find symbol variable locale.

I nearly lost my balance because of this. I thought if the Api had just shown how to import the damm thing it couldve been avoided. What sites do you guys refer to when in such a situation
 
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would generally 'GOOGLE' the error. If it is a common error you will get your solution and that is the case most of the times.
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Using an IDE will save you lots of time and frustration. Most IDE's would have pointed out your problem immediately. I would suggest using Eclipse since it is both a relatively mature product and it is free.
 
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Tontang Bei

Please note that with "import java.util.Scanner;" you import the class Scanner and with "import java.text.*;" you import all classes of the package "java.text".
[ January 31, 2007: Message edited by: Anton Uwe ]
 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you're using ecplise, SHIFT+CTRL+O will fix the import problems, and ask you to decide when it finds different optios.
Good luck!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic