Line 4 is an assignment statement and needs to be inside a code block. Right now it's immediately inside your class definition and that's not allowed. If you create an instance method or an initialization block and move that line into that, the code will compile.
Practice only makes habit, only perfect practice makes perfect.
Practice mindfully by doing the right things and doing things right.— Junilu