Kredns
Kredns

Reputation: 37211

C# equivalent to wildcard imports in Java

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

import java.awt.*;

Upvotes: 3

Views: 3996

Answers (1)

Jon Skeet
Jon Skeet

Reputation: 1501013

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.

Upvotes: 17

Related Questions