6: How To Create Classes And Objects In C# | C# Tutorial For Beginners | C Sharp Tutorial

Поделиться
HTML-код
  • Опубликовано: 12 сен 2024
  • In this C# tutorial you will learn to create classes and objects in C#. We use classes as blueprints in order to create many different objects based on these blueprints, and since objects are used all the time you will need to learn about objects.
    ➤ GET ACCESS TO MY LESSON MATERIAL HERE!
    First of all, thank you for all the support you have given me!
    I am really glad to have such an awesome community on my channel. It motivates me to continue creating and uploading content! So thank you!
    I am now using Patreon to share improved and updated lesson material, and for a small fee you can access all the material. I have worked hard, and done my best to help you understand what I teach.
    I hope you will find it helpful :)
    Material for this lesson: / lesson-material-42361704

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

  • @alexnecula
    @alexnecula 5 лет назад +276

    I want to thank you very much. Today i got hired as a junior web developer and that's because I watched your PHP tutorials (that's more popular in my area). You made me follow my dreams, you're the best!

    • @RoxusRemo
      @RoxusRemo 5 лет назад +5

      How's the job going man?

    • @alexnecula
      @alexnecula 4 года назад +17

      @Matt Dobing @Cheesecake S sorry, for some reason youtube did not notify me about any like/reply. The job is still going great. Not working with php anymore but with SAP in the same company. The pay differs from country to country and region to region so I don't think that would help anyone.

    • @slayer3run
      @slayer3run 3 года назад +5

      @@alexnecula Great to hear that! Keep it up!

  • @ammangirma3544
    @ammangirma3544 5 лет назад +86

    You are the best , i didn't like programming and never understood the concept of classes until i watched this thanks .

    • @techslugz
      @techslugz 3 года назад +4

      same, his videos really helped me understand the instantiation.

  • @Logical_Noetic
    @Logical_Noetic 4 года назад +45

    I love your way of explanation. You are my kind of teacher who explains basic and doesn't assume that others will pick up the complex concepts easily.
    When I first listened to you, I thought you must be Danish (Your English accent). Now, I have checked your About which confirms that you are indeed Danish.
    Thusind tak for fantastiske videoer

  • @dereksprogramming3233
    @dereksprogramming3233 5 лет назад +9

    Love your approach of teaching. everybody else sounds like Greek. You on the other hand make things simple! Thanks and look forward to your other vids.

    • @sifisocyprianshezi3824
      @sifisocyprianshezi3824 4 года назад +1

      Mmmmm, I wish I may be allowed to tap thumbs up a MILLION TIMES...!

  • @hjoseph777
    @hjoseph777 2 месяца назад

    After watching numerous C# RUclips videos, this individual adeptly explains a complex subject, making it understandable for everyone. He is a gifted instructor.

  • @elements2202
    @elements2202 Год назад +3

    I can honestly say I got more from this video than I have gotten from a semester and a half of school so far!!!! Thank you so much for the clear explanations. I am pretty sure I am going to be watching all of your C# and Unity video.

  • @mariastavrou2049
    @mariastavrou2049 4 года назад +10

    You are simply the best, I can’t believe I couldn’t get this in high school but 8 minutes into your video it made perfect sense. Keep it up; also you are incredibly under rated

  • @KyleMcKee92
    @KyleMcKee92 4 года назад +2

    Thanks so much for this. So many other videos assume you will understand some random small details but if you don't, you get lost. You explain all of the little details perfectly which has been great for me as a beginner. Thank you!

  • @mrmarquena9861
    @mrmarquena9861 3 года назад +5

    I forget so much stuff, but you made me remember everything in the video and understand more. I am 14 and you may have just caused me to have a future, im trying to learn to code for thefuture and just as a hobby. You have helped me so much sir, Thank you

    • @martinmtandi335
      @martinmtandi335 3 года назад +4

      Wow, you are 14 years old and you understand all this. You have a bright future, I can tell you that for sure

  • @souravsharma6092
    @souravsharma6092 4 года назад +8

    Great video, simple, effective and covers almost everything that I wanted to be cleared. Thank you

  • @gortex8383
    @gortex8383 3 года назад +1

    I have used soo many of your video's to learn programming and it has helped me enormously, But I never really left any comment on how much I appreciate your video's. You explain things very clearly and it has helped me progress a lot. Keep doing what you're doing mate. Thanks a lot!

  • @ACR995
    @ACR995 2 года назад

    I really love that you explain every little piece of the code as you go. Most teachers will just write out a massive chunk of code and then just talk about the concepts when I have no idea what the hell im looking at.

  • @graytonw5238
    @graytonw5238 Месяц назад

    Great explanation. Syntax is something that's fairly easy to grasp, but OOP has always been something I've struggled with, concept-wise. Other tutorials I've watched and books I've read will start to explain it, then before you know it they've gone off the deep end with more advanced topics. This tutorial is more like the gentle on-ramp people need, something that gets you grounded in the basics before getting into the heavier topics relating classes.

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

    this is the best explanation of classes and how to use them theat i have seen until now and i have seen quite a lot .

  • @UHDking
    @UHDking 5 лет назад +1

    I found your channel 3 days ago and I am a fan. Thank you so much when you explain like nobody else with covering security like in your mysqli tuts and other details. Your tuts both good for beginners and pros. You are the best man. Put the donate button! I will donate you 5 bucks for your time. Love that you are covering C# too :-) Thank you, thank you, thank you!

  • @carbogast7498
    @carbogast7498 4 года назад +2

    you really know how to teach Beginners , so easy to understand
    you don't confuse the person which tries to learn
    as always HQ stuff sir

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

    This is the video. Finally. Thank you for clearing this up! Usually I find vids that explain things okay but add too many other concepts in their examples without explaining what they are or why they're being used (and frankly, it would be too much if they did, so it'd be better if they just kept to the bare basics like this). Good job, brother!

  • @nickfeldman2996
    @nickfeldman2996 3 года назад +1

    As a Masters student in comp sci with only a background in teaching, I have been really struggling learning how to take my application and implementing the program code. Thank you so much for your explanations!

  • @Abacoot
    @Abacoot 2 года назад

    Thank you. First 2min I knew this is EXACTLY what I needed to remember about C# classes to start mentally thinking about my program. AMAZING!!

  • @mrfashionguy1
    @mrfashionguy1 3 года назад +2

    I just wanted to say you are an amazing person and I owe a lot of my knowledge to you, thank you Daniel

  • @remisimeon2075
    @remisimeon2075 2 года назад

    This course is so popular Visual Studio already now the entire code before you even finish the video ! Thank you !

  • @Misslivan
    @Misslivan 7 месяцев назад

    Dani this example really gave me much clarity on classes and objects, didn't really grasp it until now :') I wanna pursue a career in system dev so i'm definitely watching more of your vids! Thank you

  • @matrikater
    @matrikater 4 года назад +3

    I wish I had this when I was learning c#, you're great man, keep it up great work!

  • @Mr_Mirakulous
    @Mr_Mirakulous 3 года назад +1

    Thank you so much for this amazing video that has just clarified Classes, Properties, Fields and Methods. Thank you most especially for the diagram at the beginning of the video, seeing a visual representation of what a class is and what it is allowed to contain is Genius!
    Thank you! Thank you!! Thank you!!!

  • @jordanpowell8739
    @jordanpowell8739 3 года назад +1

    Every concept I have learned so far has been explained best by yourself. Thank you for the great content. :)

  • @petarkombov7514
    @petarkombov7514 2 года назад

    Thank you very much I just started learning C# in school and I didn't understand classes and you explained ,so thanks.

  • @princemalongo9303
    @princemalongo9303 2 года назад

    Classes, instantiation and objects were my nightmares, thanks to you for breaking these three apart.

  • @bardaccount5065
    @bardaccount5065 3 года назад

    Best instructor and incredibly clear with description and definitions. Thank you!!

  • @AlvomaniaDK
    @AlvomaniaDK 3 года назад

    I am a novice in this world of programming; I look around for way of understanding what is thought at the university, that is how I stumbled into your channel, and you know what? I am having fun with your videos; they make me feel like Hey! I can learn this stuff.

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

    i love how you learn classes before if statements it just seems so backwards and i love it

  • @DoorThief
    @DoorThief 4 года назад +2

    Hey! One of the questions I had during this episode was why you chose to use Pascal case inside the class structure instead of camel case. But I put it together on my own, realizing that every other object used Pascal case and, since it was inside that must be the normal naming convention.
    On another note, I was wondering why you chose to concatenate the Console.WriteLine string instead of using string interpolation, which I find much less tedious to write. Ex: $"Hello, my name is {Name}, I am {Age} years old}";

  • @hophuoc6660
    @hophuoc6660 2 года назад

    Thank you very much Dani, your explaination very carefully, I knew more about what I had learned in school, Hope you make more videos... From VietNam with love

  • @rajgiriyt8494
    @rajgiriyt8494 2 года назад

    @Dani Krossing don't meant to demoralize you. You are great. I Was hoping you will do it in two separate class files to create class and object but you didn't.Also I watched you all the way up to end. You are great

  • @aminamaggang1921
    @aminamaggang1921 2 года назад

    This is the best explanation about the concept of OOP. Thanks mate

  • @anneest
    @anneest 4 года назад +1

    This is a brilliant video and explanation of classes and methods (and field vs property). Thanks a lot! :-)

  • @stevenmorales2501
    @stevenmorales2501 4 года назад +1

    I finally understand classes!!! Thank you so much!

  • @rengoku81xx
    @rengoku81xx 3 года назад

    Thank you! This is the best C# stuff I've found. Many thanks!

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

    thank you so much for making the video, these complex concepts really make sense to me now!

  • @BrandonChawane
    @BrandonChawane 2 года назад

    This is probably the most important lesson in c# programming

  • @indrajitbhattacharyya
    @indrajitbhattacharyya 4 года назад +1

    Absolutely Loved the way you explained each and every details!!!

  • @slashslash92
    @slashslash92 2 года назад

    Very straightforward explanation, straightforward to understand as a beginner, very appreciated

  • @youtube-original5943
    @youtube-original5943 Год назад

    Thank you Dani! Very well explained lesson!

  • @Abdihakim0512
    @Abdihakim0512 2 года назад

    Thank you very much, your explanation are really amazing, I subbed, liked, and clicked the bell, glad to have found wonderful teacher.

  • @TheKoms
    @TheKoms 5 лет назад +1

    A Literal life saver! Thank you so much!

  • @travelubs
    @travelubs 4 года назад +1

    Thank you..this OOP is a little bit tricky for me

  • @LoraLameh
    @LoraLameh 3 года назад

    The best video for explaining classes i have watched so far ! Thanks 😊

  • @Belem1994
    @Belem1994 4 месяца назад

    Thank you, man! This video helped me a lot!

  • @FuzzyDPozzy
    @FuzzyDPozzy 5 лет назад +2

    thank you , very informative!!!
    So what can i search for to see more advanced ways about classes and objects to get some ideas?

  • @DDThang-mv9mj
    @DDThang-mv9mj 3 года назад

    I wish to see this video earlier. Thank you so much for sharing a bunch of information in this video. 🙏

  • @patrickl2960
    @patrickl2960 2 года назад

    You are the best instructor!

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

    I am so happy that you started this series. You are an amazing teacher and it gives me confidence now that I can learn C# in best way possible. Thanks so much for your help.

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

      This series was started 8 years ago by TheNewBoston who put lots of hard work and dedication into making them. These are just re-uploads from someone trying to steal credit. It even announces TheNewBoston in the beginning of the video.

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

    You're the best. Clear explanation. Thanks and keep it up!

  • @christophermartinez1769
    @christophermartinez1769 4 года назад +2

    Thanks, this is what i was looking for

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

    Great video, want to learn C# to program in unify bc the only code i now atm is python and pygame isnt that great for making larger games. Thought the transition would be hard but u explain everything verry well, thx.

  • @rajivkurryah6894
    @rajivkurryah6894 3 года назад

    Great video for beginners. Explained the concept and terminology of classes so well.

  • @papacanfly5639
    @papacanfly5639 2 года назад

    This guy taught or explain much more better than paid courses and even better than my OOP C# teacher....

  • @Keem_Software_229
    @Keem_Software_229 2 года назад

    Man I just subscribe because of this. I just started taking this Udemy course and whenever I need a deep dive into a specific topic I will definitely go back to your channel for that.

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

    I am from Brazil and I love your way of explanation.
    Thank you a lot for the video. 👏🏻

  • @AmanuelKindaya
    @AmanuelKindaya 2 месяца назад

    you are stunning man .Thank you for your help.

  • @cucumbert532
    @cucumbert532 2 года назад

    You explained it very well, thank you so much

  • @barataapsii2466
    @barataapsii2466 2 года назад

    Just learnt bunds of things from this single presentation. Thank you very much.

  • @nissimcohen6811
    @nissimcohen6811 3 года назад

    I find your tutorial excellent. Thank you for sharing your knowledge.

  • @Solanixhanti
    @Solanixhanti 2 года назад

    wonderful video i was really struggling with the concept of classes

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

    First time watching your tutorial...I subscribed right away, that's how good you are!

  • @jamiewilson5049
    @jamiewilson5049 4 года назад +2

    Thanks, this helped alot with OOP.

  • @zainrajpoot1318
    @zainrajpoot1318 3 года назад

    You are best bro. I have subscribed just watching a single video. :))

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

    this is the perfect video to know about class and objects in c# :) :) :) :) :)

  • @checkantetibo
    @checkantetibo 3 года назад

    You make it sooooooo easy to understand 👏👏👏👏👏

  • @djordje3d
    @djordje3d 3 года назад

    Perfect knowledge transfer! Bravo

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

    Thanks a ton for this video, it cleared a lot for me! Thanks again!

  • @_TMac
    @_TMac 3 года назад +1

    I was under the impression that fields were variables that you could assign a value to later on. So when you capitalized:
    public string Name;
    public int Age;
    public bool HasPet;
    it was very confusing that you didn't make them lowercase. (variables use camelCase) After doing some research I saw that 'fields' use the Pascal capitalization convention. But why? What is a 'field' exactly. I am having trouble figuring out the difference between fields and variables. All the definitions online are pretty confusing. (at least for a beginner).
    Would I be making a big mistake by filling out the Person class like this?
    public string name = "John";
    public int age = 28;
    public bool hasPet = true;
    Are there properties of fields that I would be missing out on if I used variables instead?

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

    you are better than my instructor
    big thump

  • @1997origami
    @1997origami Год назад

    Thank you for making this simple and intersting

  • @s.alihaieri1218
    @s.alihaieri1218 3 года назад

    Your video helped me.
    Thank you.

  • @lkdc_sensei6469
    @lkdc_sensei6469 3 года назад

    the best teacher. i am subscribing for sure.

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

    Thank you it was useful and with details.

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

    Excellent explanation ! Exactly what I was looking for 😊

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

    Hi Dani, I love the way you explain things so I wanted to look at your course on Patreon. When I went there I didnt really see if what I would gain access to would be something I would need. How do I see what you have available? Great vids man!

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

      My Patreon currently have copies of most of my lesson material, so people can compare their code with mine, in case they can’t get theirs working. 🙂 As well as the option of downloading my videos.
      Atm there is nothing “extra” on Patreon, since I want everything to be available through my videos here on RUclips. 🙂

  • @dacracking5768
    @dacracking5768 3 года назад

    I love your explanations.

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

    Thank you. Liked and subbed!

  • @aragidigyan8905
    @aragidigyan8905 3 года назад

    Your Tutorials are great , officially addicted to your channel , at 03:00 , there is a missing letter "C" in in the word "Access Modifiers" ))))

  • @sankh8773
    @sankh8773 3 года назад

    Thank you so much this really helped me understand the concepts!❤️

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

    thanks a lot you made it very simple

  • @aakil-bohra
    @aakil-bohra 2 года назад

    Awesome video. Thank you.

  • @nicks6351
    @nicks6351 2 года назад

    Thank you for teaching me c# Elon :)

  • @3IMAD69
    @3IMAD69 4 года назад

    THANK YOU MR.BEAST !!

  • @mahadahmed2040
    @mahadahmed2040 3 года назад

    Thanks so much I finally learned OOP!

  • @grow-with-dickson
    @grow-with-dickson 3 года назад

    Very interesting. Thanks a lot

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

    I think i might have learned some things in a different order, but wouldnt it be easier to create a new method in your main class called
    public static void Greetings(string name, int age, bool pet)?
    Its probably because its an easy example but i just want to make sure why you would choose making a class over a simple method
    Thanks :)), great tutorial btw

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

    Thank you a lot for the video. Finally I understood this topic.

  • @luizazilio5960
    @luizazilio5960 2 года назад

    very good, thank you!

  • @celestes8072
    @celestes8072 3 года назад

    omg a tremendous help!!!!

  • @kosmic85
    @kosmic85 2 года назад

    Great video… well done

  • @tariqashraf7575
    @tariqashraf7575 3 года назад

    I am lucky to be here. Thanks Man

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

    What a nice voice for teaching coding!

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

    You are a talented teacher, thanks

  • @TheLennard1998
    @TheLennard1998 4 года назад +1

    thanks for this, i think its going to help me a lot but i was wondering why you wrote the string like this:
    "Hi! My name is " + Name + " and my age is " + Age;
    and not like this:
    $"Hi! My name is { Name} and my age is {age}";
    would like to know if there is a reason to choose one over the other

    • @RossAllchurch
      @RossAllchurch 4 года назад +1

      I'm still learning, so correct me if I'm wrong, but I'm pretty sure they are the same thing. Your way is the newer way to do it and involves less typing but maybe he didn't want to explain that way of doing it yet so as not to confuse people?

  • @rupamjyotidas736
    @rupamjyotidas736 5 лет назад +1

    Can you teach about how to store data permanently using JavaScript?

  • @Emi-hi3xf
    @Emi-hi3xf 4 года назад

    Thank you! LOVE IT.

  • @sahanahiremath8945
    @sahanahiremath8945 2 года назад

    Thanks man 🙌