C# C# Objects Encapsulation and Arrays Ternary If

Kamil Borowski
Kamil Borowski
4,676 Points

Unexpected task bummer

Hi, Can anyone tell me why that code is wrong? I've tried it in the workspace and it works there.

int value = -1;
string textColor = null;

(value < 0) ? textColor = "red" : textColor = "green";

1 Answer

You have to change the value of textColor, so you'll want to begin with textColor = .