C# equivalent to wildcard imports in Java

前端 未结 1 1572
心在旅途
心在旅途 2020-12-21 17:29

Is there a way in C# to import everything inside a namespace like there is in Java with the wildcard character?

import java.awt.*;
相关标签:
1条回答
  • 2020-12-21 18:11

    That's what the normal using directive does. For instance:

    using System;
    

    means you can use Console, Guid, Int32 etc without qualification. The closest equivalent to the single import in Java is:

    using Console = System.Console;
    

    (etc)

    but that's not used very often.

    0 讨论(0)
提交回复
热议问题