C # how does the console work?

This is a pretty simple question

But how, for example,

Console.Write("test");

Job?

A console is a class, not an object.

I use the console as an example because it is commonly used, but I have seen many examples of using Class.method () instead of object.method ().

+4
source share
4 answers

This method is called the static method: Static classes and members of the static class (C # Programming Guide) .

You do not need an instance to call a static member of the class:

, , . , . , . , , . , , .

+7

Write - , . . .

+2

Write - static Console, .

+1

Console.Write - , .

0

All Articles