So I’m getting this error and I’m not sure how to fix it. I am also unsure if i’m supposed to use an if statement to append hobbies. Or is there something I’m missing?
Profile.cs(16,124): error CS0246: The type or namespace name 'h
obbies' could not be found (are you missing a using directive o
r an assembly reference?) [/home/ccuser/workspace/csharp-dating
-profile/DatingProfile.csproj]
Profile.cs(16,120): error CS1736: Default parameter value for '
hobbies' must be a compile-time constant [/home/ccuser/workspac
e/csharp-dating-profile/DatingProfile.csproj]
Alright I fixed one of the errors but I’m still being told to make hobbies a compile time constant.
Should I know what a compile- time constant is? I don’t remember reading about it at any point.
Anyways made progress.
Profile.cs(16,120): error CS1736: Default parameter val
ue for 'hobbies' must be a compile-time constant [/home
/ccuser/workspace/csharp-dating-profile/DatingProfile.c
sproj]
As I recall, from the project, we don’t provide a hobbies argument when we instantiate a Profile object. We use the setHobbies method to add hobbies later. Therefore, your constructor method should not have a parameter for hobbies.