C# abstract classes 👻

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

КОМЕНТАРІ • 102

  • @BroCodez
    @BroCodez  3 роки тому +27

    using System;
    namespace MyFirstProgram
    {
    class Program
    {
    static void Main(string[] args)
    {
    // abstract classes = modifier that indicates missing components or incomplete implementation
    Car car = new Car();
    Bicycle bicycle = new Bicycle();
    Boat boat = new Boat();
    //Vehicle vehicle = new Vehicle(); //can't create a vehicle object
    Console.ReadKey();
    }
    }
    abstract class Vehicle
    {
    public int speed = 0;
    public void go()
    {
    Console.WriteLine("This vehicle is moving!");
    }
    }
    class Car : Vehicle
    {
    public int wheels = 4;
    int maxSpeed = 500;
    }
    class Bicycle : Vehicle
    {
    public int wheels = 2;
    int maxSpeed = 50;
    }
    class Boat : Vehicle
    {
    public int wheels = 0;
    int maxSpeed = 100;
    }
    }

  • @redblade79x
    @redblade79x 2 роки тому +44

    I have my first technical interview later this week. Your videos have been the biggest help over anything else I’ve seen on UA-cam in getting me prepared. The analogies make plenty of sense and are succinct. Great job!

    • @Trashcandogchoir
      @Trashcandogchoir 2 роки тому +8

      Did you get the job?

    • @CityCata
      @CityCata 2 роки тому +6

      I hope he got it. Im also preparing for interviews in January so Im just browsing youtube reviewing info😄

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

      @@CityCata did you get the job?

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

      Dont stress. Not about knowing everything, about seeing how you think and problem solve.

  • @Fraps224
    @Fraps224 3 роки тому +15

    your explanations are awesome

  • @leonvieira3877
    @leonvieira3877 2 роки тому +9

    Quick and simple, nice refresher/introduction to the concept. Much appreciated.

  • @faycaled3058
    @faycaled3058 2 роки тому +57

    After 2 years of coding I've finally understand what is the purpose of this "abstract" thanks to you !

    • @nguyentiensu3825
      @nguyentiensu3825 Рік тому +8

      bro same, school is the worse place to studied code lmao

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

      ​@@nguyentiensu3825school is worst place to study absolutely anything

    • @MR-xt3wp
      @MR-xt3wp Місяць тому

      @@nguyentiensu3825 hahah me to, i only understand coding because of youtube videos like this 🙂

  • @TXPhoenix79
    @TXPhoenix79 Рік тому +4

    This simple explanation is EXACTLY what I was looking for. Thank you.

  • @lilrex2015
    @lilrex2015 9 місяців тому +1

    i struggled with interfaces and abstracts for years. Your videos on this have cleared that up. Thank you;.

  • @p4nd4444
    @p4nd4444 Рік тому +2

    I bless the universe that you exist in the same lifetime as me. Thank you so much. I was battling with classes and you narrowed it down for me. I hope this applies well to the work I'm about to do. Thank you once more.

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

    Better explanation than a c# book and ChatGPT. Bravo !

  • @100PercentHPGames
    @100PercentHPGames Рік тому

    Your videos are perfect. It’s great that you’re sharing the videos in a few minutes

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

    Great video!!! This really helped me finally understand what abstract is used for. Thumbs Up!!

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

    you're the best & coolest coder out there !! keep it up man

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

    Brief, short, clear, concise, perfect!

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

    I loved that example 😂

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

    You made it so easy to understand that I just came here to comment. Straight to the point videos are so valuable! Already liked the video and subscribed to your channel🎉

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

    to the point, clear and concise and stuff. I think i'm gonna come here often

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

    Excellent video. Concise and to the point.

  • @gymforcesoftware7845
    @gymforcesoftware7845 6 місяців тому +1

    Comment.random();

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

    Random randomComment = new Random();

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

    An entire university C# class topic simplified in 2.5min. Wow! Unbelievable

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

    THIS VIDEO MAKES MORE SENSE than all 30 - 40 mins Videos that i watched on UA-cam

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

    Thanks man! Simple and straight to the point! Your explanation actually clicked in my brain!!

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

    Thx Bro, the repetition in the end massaged the information into my brain!

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

    Watched this before my exam and all I can say is. Thank you sir

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

    Thanks Bro For this amazing tutorial

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

    I like how short an precise all of these videos are, thanks

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

    Just straight up brilliant. Just learnt abstraction in under 3 minutes ...

  • @romantabacek7028
    @romantabacek7028 4 години тому

    God bless you.

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

    love u bro you are the best teacher i have got

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

    clean and simple in short video. thank you so much.

  • @adambosick3137
    @adambosick3137 10 місяців тому

    Loving all of your content.

  • @cimiur
    @cimiur 4 місяці тому

    concise and helpful. thanks!

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

    Bro ! The explanation is awesome!🎉

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

    Awesome content, very simple

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

    you were the first to help me understand the "why"

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

    ty dude u explained this in 2 minutes my cs professor coudn't do that in 45 gj

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

    Bro explained this so well that I'm compelled to comment saying that he did so

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

    you are a lifesaver man

  • @ISRAEL_the1st
    @ISRAEL_the1st Місяць тому

    well explained, thanks!

  • @0lafs
    @0lafs Рік тому

    Awesome video man

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

    Wow! Nice!

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

    Nice!

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

    Thank you, I understand what abstract mean now :-)!

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

    Thank you so much Brocode!

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

    very clear, thanks so much

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

    Short and sweet. Thanks man.

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

    Makes so much sense

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

    je je je

  • @nashonightmare
    @nashonightmare 11 місяців тому

    Bro earned my sub at 1:43

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

    very helpful thank you

  • @chatGPT-ni7gx
    @chatGPT-ni7gx 6 місяців тому

    tôi nghĩ ad lên làm thêm video cho ngôn ngữ c# đi vì ,còn rất nhiều kiến thức của c# mà ad chưa làm .

  • @ghalaaldosari1853
    @ghalaaldosari1853 3 місяці тому

    💯

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

    1:48 - when bro says 'adds a bit of security to the program' - what does this mean exactly?

  • @saraybaqal1704
    @saraybaqal1704 2 місяці тому

    nice

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

    Really useful! Thank you a lot.

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

    I tried to thumbs up the video but I've been here before..

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

    thanks for the refresher bro

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

    many thanks

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

    💙💙

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

    Thanks bro

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

    Thanks for the video Bro.

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

    Nice, but I mean that you should be expande your explanation by some examples with more reason to use this classes

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

    noice

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

    I somehow understood this. Thanks!

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

    why do we pay 10 of thousands every year for school for programming when we could have information like this on youtube and many more places

  • @ag4-z4z
    @ag4-z4z 9 місяців тому

    Thanks bro.

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

    So abstraction is? when you want to declare a class but its only use is to be implemented as a subclass? (Or that thing to the right of 'Bicycle :')

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

    ty

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

    can you recommend me some developing groups, which can help me getting more flexibel with c#

  • @RM-xl1ed
    @RM-xl1ed 12 днів тому

    Thanks Bro code!

  •  3 роки тому

    Thanks Bro!

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

    First bro

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

    Thanks

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

    Thanks man.

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

    rdm comment good vid

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

    link to pure virtual functions ? instead of using the word "abstract" we can define a purely virtual function ? Thanks for the video

  • @SweepAndZone
    @SweepAndZone 9 місяців тому

    But what the hell is the use case for something like this over just using a normal class?

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

    lesson check😇

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

    Doesn't the static keyword do the same thing?

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

    Literally the whole point of classes, ESPECIALLY abstract classes, is for them to act as a template, a skeleton, of which all the child classes can build upon, to eliminate redundant code.
    Vehicle can have the protected public int wheels, then you can set the number of wheels for each instance object using the appropriate child constructor. Same goes for the maxSpeed. Both properties can go in the child constructors.

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

    Random comment down below

  • @definitelynotchris4776
    @definitelynotchris4776 3 місяці тому

    void

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

    A random comment down below.

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

    Random comment

  • @BantuBeya
    @BantuBeya 4 місяці тому

    Random*****

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

    //random

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

    random comment

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

    Thanks. I used classes extensively and and only understand Now why I did this very thing... I looked at others code then knew I needed to modify with abstract... But never fully understood WHY... The worse part of my struggles with classes was then......using abstract where I should not have...

  • @ireqkub
    @ireqkub 9 місяців тому

    Thanks

  • @БулатПочанов
    @БулатПочанов Рік тому

    random comment down below

  • @jt.633
    @jt.633 Рік тому

    Random comment

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

    //random

  • @sammoc1985
    @sammoc1985 8 місяців тому

    random comment

  • @MahmoudBahnasawy-yk2fj
    @MahmoudBahnasawy-yk2fj 8 місяців тому

    Thanks

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

    Random comment