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; } }
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!
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.
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🎉
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.
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...
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;
}
}
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!
Did you get the job?
I hope he got it. Im also preparing for interviews in January so Im just browsing youtube reviewing info😄
@@CityCata did you get the job?
Dont stress. Not about knowing everything, about seeing how you think and problem solve.
your explanations are awesome
Quick and simple, nice refresher/introduction to the concept. Much appreciated.
After 2 years of coding I've finally understand what is the purpose of this "abstract" thanks to you !
bro same, school is the worse place to studied code lmao
@@nguyentiensu3825school is worst place to study absolutely anything
@@nguyentiensu3825 hahah me to, i only understand coding because of youtube videos like this 🙂
This simple explanation is EXACTLY what I was looking for. Thank you.
i struggled with interfaces and abstracts for years. Your videos on this have cleared that up. Thank you;.
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.
Better explanation than a c# book and ChatGPT. Bravo !
Your videos are perfect. It’s great that you’re sharing the videos in a few minutes
Great video!!! This really helped me finally understand what abstract is used for. Thumbs Up!!
you're the best & coolest coder out there !! keep it up man
Brief, short, clear, concise, perfect!
I loved that example 😂
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🎉
to the point, clear and concise and stuff. I think i'm gonna come here often
Excellent video. Concise and to the point.
Comment.random();
Random randomComment = new Random();
An entire university C# class topic simplified in 2.5min. Wow! Unbelievable
THIS VIDEO MAKES MORE SENSE than all 30 - 40 mins Videos that i watched on UA-cam
Thanks man! Simple and straight to the point! Your explanation actually clicked in my brain!!
Thx Bro, the repetition in the end massaged the information into my brain!
Watched this before my exam and all I can say is. Thank you sir
Thanks Bro For this amazing tutorial
I like how short an precise all of these videos are, thanks
Just straight up brilliant. Just learnt abstraction in under 3 minutes ...
God bless you.
love u bro you are the best teacher i have got
clean and simple in short video. thank you so much.
Loving all of your content.
concise and helpful. thanks!
Bro ! The explanation is awesome!🎉
Awesome content, very simple
you were the first to help me understand the "why"
ty dude u explained this in 2 minutes my cs professor coudn't do that in 45 gj
Bro explained this so well that I'm compelled to comment saying that he did so
you are a lifesaver man
well explained, thanks!
Awesome video man
Wow! Nice!
Nice!
Thank you, I understand what abstract mean now :-)!
Thank you so much Brocode!
very clear, thanks so much
Short and sweet. Thanks man.
Makes so much sense
je je je
Bro earned my sub at 1:43
very helpful thank you
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 .
💯
1:48 - when bro says 'adds a bit of security to the program' - what does this mean exactly?
nice
Really useful! Thank you a lot.
I tried to thumbs up the video but I've been here before..
thanks for the refresher bro
many thanks
💙💙
Thanks bro
Thanks for the video Bro.
Nice, but I mean that you should be expande your explanation by some examples with more reason to use this classes
noice
I somehow understood this. Thanks!
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
Thanks bro.
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 :')
ty
can you recommend me some developing groups, which can help me getting more flexibel with c#
Thanks Bro code!
Thanks Bro!
First bro
Thanks
Thanks man.
rdm comment good vid
link to pure virtual functions ? instead of using the word "abstract" we can define a purely virtual function ? Thanks for the video
But what the hell is the use case for something like this over just using a normal class?
lesson check😇
Doesn't the static keyword do the same thing?
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.
Random comment down below
void
A random comment down below.
Random comment
Random*****
//random
random comment
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...
Thanks
random comment down below
Random comment
//random
random comment
Thanks
Random comment