Answer the question
In order to leave comments, you need to log in
Why can't you use Console inside your class?
Hello everyone!
Why can't you use the Console inside your class?
class Test
{
Console.WriteLine("text");
}
Answer the question
In order to leave comments, you need to log in
You are trying to call WriteLine in the wrong place. Immediately inside a class, only its fields or methods can be described. That is, first you need to create a method in your class
class Test
{
public void TestMethod()
{
Console.WriteLine("text");
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question