aspose file tools
The moose likes Beginning Java and the fly likes symbol not found? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "symbol not found?" Watch "symbol not found?" New topic
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
    
  15

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
    
  14

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: symbol not found?
 
Similar Threads
NumberFormat.format()
double
NUmberFormat
Percentages displayed
How to represent int 1 as 0001?