C# Static Classes

Поделиться
HTML-код
  • Опубликовано: 5 ноя 2024
  • Sometimes it just makes sense to never create an instance.

Комментарии • 6

  • @bruceb85
    @bruceb85 Год назад

    So you can access static functions in another class without that class declared as static?

  • @mwaqasaz
    @mwaqasaz 9 лет назад +1

    Loved the way u teach

  • @nishthakapur1914
    @nishthakapur1914 4 года назад

    Why do we need to create static methods? i didnt understand the use of it? just to avoid creating instance of it so that it can be called using Class name?

  • @jvsnyc
    @jvsnyc 5 лет назад

    4:25 thru 4:55, where the only way you could call the methods is by explicitly saying StaticClassName.StaticMethodName()
    That was true when you said it, but since then they added a "using static packagename.ClassName.MethodName
    right?
    Not that is necessarily better, since you don't really see where it comes from.

  • @nukec
    @nukec 8 лет назад

    So everything that is static(variables, classes, references) is created on compile time, before runtime? Aha?

    • @JamieKingCS
      @JamieKingCS  8 лет назад +3

      +Amel Salibasic Yea, pretty much. With managed code in .NET, the details are a bit different. Once the JITter compiles the code to machine code, however, yes, that's absolutely true.