“using” directive in Java

前端 未结 4 901
醉话见心
醉话见心 2021-01-18 06:55

When the type name is too long, in C# i can create alias like this:

using Dict = System.Collections.Generic.Dictionary;
4条回答
  •  -上瘾入骨i
    2021-01-18 07:38

    I second Yuval's subclass trick. It's not a big deal in performance or semantics.

    In C#, Dictionary is also a NEW type; each instantiation of a generic type creates a new class at runtime.

提交回复
热议问题