为什么变量在java中声明为static?

时间:2014-06-23 16:07:18

标签: java variables user-interface static

我正在关注一本名为" Big Java late objects"现在我正在研究GUI。 我无法理解的原因是在下面的代码中。一些字段变量被声明为"静态"为什么:

public class InvestmentFrame2 extends JFrame{

   private static final int FRAME_WIDTH = 450;
   private static final int FRAME_HEIGHT = 100;

   private static final double DEFAULT_RATE = 5;
   private static final double INITIAL_BALANCE = 1000;

   private JLabel rareLabel;
   private JTextField rateField;
   private JButton button;
   private JLabel resultLabel;
   private double balance;

}

0 个答案:

没有答案