请教个问题
/**
* Created by IntelliJ IDEA.
* User: fengzhizi
* Date: 2004-10-26
* Time: 23:08:51
* To change this template use Options | File Templates.
*/
import java.text.DecimalFormat;
import javax.swing.*;
public class Interest{
public static void main(String args[])
{
double amount,
principal=1000.0,
rate=.05;
DecimalFormat precisionTwo=new DecimalFormat("0.00");
JTextArea outputText=new JTextArea(11,20);
outputTextArea.append("Year\tAmount on deposit\n");
for(int year=1;year<=10;year++)
{
amount=principal*Math.pow(1.0+rate,year);
outputTextArea.append(year+"\t"+
precisionTwo.format(amount)+"\n");
}
JOptionPane.showMessageDialog(
null,outputTextArea,"Compound Interest",
JOptionPane.INFORMATION_MESSAGE);
System.exit(0);
}
}
以上是我写的源代码
为何会出现如下的错误?
D:\jdk1.5.0>javac Interest.java
Interest.java:22: cannot find symbol
symbol : variable outputTextArea
location: class Interest
outputTextArea.append("Year\tAmount on deposit\n");
^
Interest.java:27: cannot find symbol
symbol : variable outputTextArea
location: class Interest
outputTextArea.append(year+"\t"+
^
Interest.java:32: cannot find symbol
symbol : variable outputTextArea
location: class Interest
null,outputTextArea,"Compound Interest",
^
3 errors
请各位帮帮忙。谢谢了。