Static Class Attributes | C# | Tutorial 29

Поділитися
Вставка
  • Опубліковано 7 січ 2025

КОМЕНТАРІ •

  • @Archie_12321
    @Archie_12321 3 місяці тому +8

    i started watching these videos when i was a 13 year old kid struggling learning to code for the first time. i used them to learn how to make small games on unitiy. being dsylexic and adhd i wasnt very gifted academicly but i could code. thanks to these free videos. im now studying software engineering at my dream university and after four years ive looped back around to this channel. its funny how life works.

  • @chris8534
    @chris8534 3 роки тому +9

    I like how you recreate the class every video to be different - it's really re-enforcing how the concept works.

  • @alexpopowski1318
    @alexpopowski1318 Рік тому

    You helped me have a breakthrough. I’ve been struggling to wrap my head around static for a while. Thanks so much!

  • @babakasheri6379
    @babakasheri6379 2 роки тому +1

    Your tutorials make me more productive, thanks bro

  • @nikolastevkovski818
    @nikolastevkovski818 3 роки тому +4

    This tutorials are really awesome, you should make one for stack/heap; reference types/value types recursion etc...

  • @fatherdome5457
    @fatherdome5457 Рік тому

    Hey Mike.
    I really enjoy your videos regarding c#.
    Thanks for explaining it so well. It is very helpfull for me also just listening to your explanations while i’m walking my dog. That tends to bring me faster to the “ooooohhhhhh” moment😊.
    Well of course it might take at least some pre knowledge about termilogy and functions, but it is fun to experience that light-bulb moment.
    Only draw is that i don’t keep an eye of my dog finding and eating stuff, not suitable for dogs😊…..

  • @halooshka1904
    @halooshka1904 6 років тому +8

    I actually understood what's going on?! Thank you so much for this!

  • @qianbang_
    @qianbang_ 6 років тому +3

    Love how you explain things very deep and thoroughly

  • @TheAmazeer
    @TheAmazeer 4 роки тому +1

    Thanks dude it's crystal clear

  • @101Jman
    @101Jman 4 роки тому

    Nice clear explanation. Cheers

  • @ab-yp2gn
    @ab-yp2gn 3 роки тому +1

    Thanks!!! this was great :-)

  • @chrisromanovfx
    @chrisromanovfx 3 роки тому

    Mike, these videos are incredibly clear and helpful. Any chance you could add a few more Unity-minded C# examples? Like Coroutines and Events? And grabbing and sharing values between scripts?

  • @kolawoleadekunle5364
    @kolawoleadekunle5364 6 років тому

    Many thanks Mike...
    Pls can you do a video on concepts of OOP with explanations for modeling Aggregation, Composition et.c using C# ?

  • @ntatall762
    @ntatall762 2 роки тому

    please explain copy constructor in simple and easy step, and explain how it work and where i can use it

  • @מלכה-ג8ו
    @מלכה-ג8ו 2 роки тому

    תודהה סרטון מעולה!!!!!!!!!!!1

  • @davimuna1434
    @davimuna1434 4 роки тому

    Please help us do oop 4 pillers in c# i love your explanation

  • @jannickbreunis
    @jannickbreunis 4 роки тому

    Great explanation, again. Question, why do you prefix an a to your parameters? Is that for a reason or just because a is the first letter of the alphabet. And, wouldn't it be better if you'd use this.title = title; in the constructor?

    • @tsareena5899
      @tsareena5899 4 роки тому +1

      He said before in his past C# tutorials. 'a' is just a notation for an argument but you can really name it any.

    • @milesblack1830
      @milesblack1830 3 роки тому

      its because in a constructor it won't let you use the same name for the variable being assigned and the paramater. So you can't do:
      public Song(string title)
      {
      title = title
      }
      Instead you have to name the parameter something else.

    • @firey7710
      @firey7710 5 місяців тому

      @@milesblack1830 i know 2 years late but cant u just do this.title = title?

  • @amyyang2181
    @amyyang2181 Рік тому +1

    thank you, explain clear and easy to understand

  • @bakkalimourad7977
    @bakkalimourad7977 3 роки тому

    thanks

  • @Gorlykio2k34
    @Gorlykio2k34 6 років тому +11

    wtf? why are you calling "Properties", Attributes?

  • @IvanYorgov
    @IvanYorgov 5 років тому +9

    Felds are not attributes, nor properties

  • @giacomorinaldi
    @giacomorinaldi 2 роки тому

    hello. you dont need to write public static int GetSongCount ?

  • @cheshire9646
    @cheshire9646 3 роки тому

    These are fields, attributes are something else. you explain things well but it's a shame you didn't check that you are you using the right terms.

    • @milesblack1830
      @milesblack1830 3 роки тому +2

      fields == attributes....

    • @upcom1ng116
      @upcom1ng116 3 роки тому

      It's not hard for you check other term neither.

    • @seccom_
      @seccom_ 5 місяців тому

      @@milesblack1830 nope

  • @greg5326
    @greg5326 3 роки тому +1

    I literally skipped 80% of this video and understand the concept completely. Static means it spans the entire class. Great. Why do you describe every single line of code?

    • @alanmoreno6330
      @alanmoreno6330 2 роки тому

      Because ur mom

    • @seccom_
      @seccom_ 5 місяців тому

      because it's a course for beginners

  • @tsareena5899
    @tsareena5899 4 роки тому +1

    A solution I tried messing with:
    In the program class:
    //[STATIC CLASS ATTRIBUTES]//

    Song holiday = new Song("Holiday", "Green Day", 200);
    Song kashmir = new Song("Kashmir", "Led Zeppelin", 150);
    Song lala = new Song("fdsafas", "fdsafsdn", 800);
    //This should directly be at the end of that object. If in accordance with his tutorial.
    // However, how do we really get the student count?
    Console.WriteLine(Song.songCount);
    Console.WriteLine(holiday.getSongCount());
    Console.WriteLine(kashmir.getSongCount());
    Console.WriteLine(lala.getSongCount());
    Console.ReadLine();
    In the song class:
    public string title;
    public string artist;
    public int duration;
    public static int songCount = 0;
    public int count;
    public Song(string aTitle, string aArtist, int aDuration)
    {
    title = aTitle;
    artist = aArtist;
    duration = aDuration;
    count = songCount++;
    }
    public int getSongCount()
    {
    return count + 1;
    }