Compiler Error CS0844
An identifier can have only one meaning in a given block. Local variables that have the same name as class fields can hide the field by introducing a second meaning for the identifier. Therefore the compiler generates an error when you refer to a class field in a method, and then declare a local variable by the same name.
To correct this error
Use this.num to refer to the class field.
Give the local variable a different name from the class field.