C# C# Basics Console I/O Variables

Javier Lim
Javier Lim
476 Points

how do we initialize a var

i always log the thingy on the code editor but there is always an error

CodeChallenge.cs
string bookTitle = "harrycporter";
string bookTitle;
Javier Lim
Javier Lim
476 Points

Thanks for you time!

1 Answer

Steven Parker
Steven Parker
163,574 Points

Your first line should satisfy the challenge by itself.

The second line is causing an error because the variable cannot be declared twice. It should be removed.

Javier Lim
Javier Lim
476 Points

so do you know what is the code for it

Steven Parker
Steven Parker
163,574 Points

The correct code is your first line. Just remove the second one.