| Author |
symbol not found?
|
ian myers
Greenhorn
Joined: Apr 11, 2011
Posts: 7
|
|
i am trying to compile this code
but whenever i do i get
Decimals.java:3: missing method body, or declare abstract
public static void main (String[]args);
^
Decimals.java:9: cannot find symbol
symbol : class getCurrencyInstance
location: class java.text.NumberFormat
java.text.NumberFormat nf = new java.text.NumberFormat.getCurrencyInstance();
^
2 errors
Anyone have any suggestions?
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24081
|
|
Hi,
Welcome to JavaRanch!
1) The ";" at the end of the "main" line doesn't belong there
2) You don't write "new java.text.NumberFormat.getCurrencyInstance()" -- you just call the method getCurrenctInstance() to get the object you want:
|
[Jess in Action][AskingGoodQuestions]
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56528
|
|
|
Hint: carefully inspect line 3. What's amiss?
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
ian myers
Greenhorn
Joined: Apr 11, 2011
Posts: 7
|
|
|
haha i got it thanks guys
|
 |
 |
|
|
subject: symbol not found?
|
|
|