cannot assign value to “final” variable in java

前端 未结 7 1287
臣服心动
臣服心动 2020-12-31 08:44
 private void pushButtonActionPerformed(java.awt.event.ActionEvent evt)
{
    final int c=0;
    final JDialog d=new JDialog();
    JLabel l=new JLabel(\"Enter the E         


        
7条回答
  •  耶瑟儿~
    2020-12-31 09:18

    This is the reason that keyword final exists in java. The variable is final, i.e. its value cannot be changed. If you have to change the value do not mark variable as final.

提交回复
热议问题