Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
752 views
in Technique[技术] by (71.8m points)

namespaces - 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.*;
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...