:twisted:
Bom é o seguinte ao tentar compilar o programinha abaixo:
1 import java.text.NumberFormat;
2 import java.util.Locale;
3 import javax.swing.JOptionPane;
4 import javax.swing.JTextArea;
5
6 public class Juros1{
7
8 public static void main( String args[] )
9 {
10
11 double amount, principal = 1000.0, rate = 0.05;
12
13 NumberFormat moneyFormat =
14 NumberFormat getCurrencyInstance( Locale.US );
15
16 JTextArea outputTextArea = new JTextArea();
17
18 outputTextArea.setText( "Ano\tQuantia no Deposito\n" );
19
20 for ( int year = 1; year <= 10; year++ )
21 {
22
23 amount = principal * Math.pow( 1.0 + rate, year);
24
25 outputTextArea.append( year + "\t" +
26 moneyFormat.format( amount ) + "\n" );
27 }
28
29 JOptionPane.showMessageDialog( null, outputTextArea, " Juros Compostos", JOptionPane.INFORMATION_MESSAGE );
31
32
33 System.exit( 0 );
34 }
35}
e na linha 14 tá dando o seguinte erro:
Juros1.java ';' expected
NumberFormat getCurrencyInstance( Locale.US );
mas como o ponto e virgula é esperado se já tem?
por isso o #@*& não compila; se alguém puder me dar um help eu agradeço....
WS