+ 2
C# Accessor "get" not working in Code Coach.
I've only seen one other person have this problem, and that post is over a year old, so I figured I'd repost it. "Get" is not working in Code Coaches. Usually, when you type it's white but changes to purple or something when it's working but mine stays white and doesn't execute the action. So I can't pass the Code Coach. Link to code for reference. What do I do? https://code.sololearn.com/cEmwR3EFkGQF/?ref=app
7 Answers
+ 3
Nothing is wrong with SoloLearn compiler. The problem is in your code.
Delete line 1 ~ 24
You have overlapping code with similar content, one is broken so keep the one at the bottom (starts at line 25)
Inside Program.Main, you should be referring to `AccountNum` get property, not the private member <accountNum>
Console.WriteLine(card1.AccountNum); ./ <-- here
(Edit)
OP cleaned the overlapped code by saving the code again. Better keep an eye out for more overlapping code incidents ahead.
+ 2
Code not saved properly..! Is this code related to question? No changings in value!!
Call the property, not the private variable.
Console.WriteLine(card1.AccountNum); #đ
+ 2
It's a General mistake by anyone. Common mistake by newbies.. Even some what difficult to find too. Don't worry..
+ 1
Resaved the code to fix that. No idea why it did that but the point is "get" is not working.
+ 1
get property works, your code is the problem.
+ 1
I saw the error you both pointed out after I stared at it a little longer. I still dont understand why get is staying white so I thought that was the problem. đźâđš maybe I'm not cut out for coding.
+ 1
Come on, don't be taken aback by syntax highlighting difference. When the code works we can cast aside syntax highlighting difference.SoloLearn's code editor supports many languages, a miss in setting for syntax highlighting is a *possibility*