skip to Main Content

I have this error when I try to run Alignment.Error in Alignment

2

Answers


  1. The final keyword stands for constant. Since it is a constant, not a variable, initialization is required. Remove the final keyword.

    Because final is a constant keyword, its value cannot be changed.

    There are two main keywords for constants: const and final. const is defined at compile time and final is defined at runtime.

    Login or Signup to reply.
  2. Just Remove final keyword .

    otherwise you can not assign any value to alignment variable.

    like this.

    AlignmentDirectional alignment;
    
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search