-4

I am creating gui calculator in Java

I am using IDEA

programme runs successfully but it shows an error that Field '(any field)' may be 'final'......

I don't know what it is

Here is image of Error

  • It is not *error* (otherwise your code wouldn't run) but information that you can make those fields `final`. – Pshemo Sep 05 '20 at 13:24
  • Does this answer your question? [Should I declare swing components in my application final..?](https://stackoverflow.com/questions/37617772/should-i-declare-swing-components-in-my-application-final) – Kulfy Sep 05 '20 at 13:26

1 Answers1

1

It's a warning/information message telling you that these variables are better to be declared as final. Whenever your IDE finds cases where you have not assigned anything to a variable, except at the time of initialization, it may give you such a warning/information message so that you can consider adjusting the code if required. I believe, you already understand the concept of the keyword, final in Java.

Arvind Kumar Avinash
  • 71,965
  • 6
  • 74
  • 110