+ 2
C# using system is needed?
Every c# code needs using system. If so, why did they make using system if we are going to type it every time? If not, are there codes you can make without using system???
3 Answers
+ 7
Well first of all you need to understand the purpose of <using> in the code.
When you write
using System;
it actually means you're going to make a reference to the library class available in the System namespace.
Therefore if you want to avoid writing it, you'll need to prefix every statements that's under the System namespace like following:-
System.Console.WriteLine("42");
System.Console.WriteLine("abc");
Otherwise without it the compiler will not understand the definition of Console as it's coming from nowhere.
Hopefully it helps! đ
+ 2
No you donât need using system. It just assumes that you may need the classes from system, since there are many useful ones. You can remove it if youâre not using classes such as Random.
0
@Ariela The main system method i use is Console.Write
Is there anyway to get an output without using system?