Main

Level Up Your C# Skills: Discover the Magic of Object-Oriented Programming

Mastering Object-Oriented Programming: Class, Object, and Encapsulation Tutorials | Beginner's Guide to OOPS: Class, Object, and Encapsulation Made Easy. #csharp #codingchallenges #comedy #csharptutorial #funny #fullstack #technology #carrier #algorithm #algorithms #csharp #dotnetprojectcenters #versioncontrol #cleancode #techtalks #coderslife #codemagic #codingwizard #csharpprogramming #dotnetframework #dotnetcore #softwaredevlife #codesolutions #codedocumentation #programminglanguages #dotnetdevelopment #softwaredesign #techskills #codetesting #CodeArchitecture #programmingtips C# Oops kya hai? Class and objects https://youtu.be/pFUBDHRRu7A?si=wvciZxysDd0qdNc_ : variables and data types in C# Welcome to my YouTube channel dedicated to C# Object-Oriented Programming (OOP)! 🎉 On this channel, you'll find comprehensive tutorials and in-depth explanations of C# OOP concepts, with a primary focus on Class, Object, and Encapsulation. Whether you're a beginner looking to understand the fundamentals or an experienced programmer aiming to sharpen your skills, this channel is the perfect place for you. Here's what you can expect to find on this channel: Class Demystified: We'll break down the concept of classes in C#, explaining how they act as blueprints for objects, defining their attributes and behaviors. Object-Oriented Principles: Dive deep into the principles of OOP, such as Inheritance, Polymorphism, Abstraction, and Encapsulation, with a strong emphasis on the latter. Encapsulation Explained: Learn the importance of encapsulation in C#, how it helps protect your data, and how to implement it effectively in your programs. Hands-On Examples: Follow along with practical examples and real-world scenarios to solidify your understanding of C# OOP concepts. Best Practices: Discover best practices and coding standards to ensure your C# OOP code is clean, maintainable, and efficient. Problem-Solving: Explore common problems and challenges faced while working with C# OOP and learn how to overcome them. Tips and Tricks: Stay up to date with the latest tips and tricks for mastering C# OOP, ensuring you can write robust and elegant code. #fullstack #technology #carrier #algorithm #algorithms #csharp #dotnetprojectcenters #versioncontrol #cleancode #techtalks #coderslife #codemagic #codingwizard #csharpprogramming #dotnetframework #dotnetcore #softwaredevlife #codesolutions #codedocumentation #programminglanguages #dotnetdevelopment #softwaredesign #techskills #codetesting #CodeArchitecture #programmingtips C# Programming Object-Oriented Programming Class and Object Encapsulation Tutorial C# OOP Basics Inheritance in C# Polymorphism Examples Abstraction in CSharp OOP Principles Explained C# Coding Examples Object-Oriented Design C# Software Development CSharp Beginners Guide Object-Oriented Concepts C# Programming Tips Learn Object-Oriented Programming CSharp Encapsulation Techniques Coding Best Practices OOP Patterns in C# Advanced C# OOP

CodeArya

6 months ago

[music] Hello viewers, welcome to my channel, today we will talk about Babs Principal. We will know what is the bus concept, what are its four pillars and what is the class. What is object and much more so let's start without any delay and Some Better Understand What is Paas Paas is a design philosophy that stands UPS uses a different set of object-oriented programming systems. Programming languages ​​which are our old procedural programming languages Which was so close that it was not possible
in them, everything in UPS is in the form of an object. Is grouped or we can say that we group everything as an object. So that it becomes very easy for us to reuse the code. Code Reuse Ability We can understand it well through Babb's four pillars and four concepts which are Is our encapsulation abstraction inheritance and polymorphism You will understand encapsulation, constraint inheritance and polymorphism. Let's start we know class, what is class, class is a framework. With the help of which
you can define your custom type, this means that you can use it in many ways. You can create various properties, methods and events of different types. Class is a collection of objects which is composed of three things: Name Atrobic We used to do our acrobatics inside it and what action to perform from that class. It is used to make its methods, so in simple words we can say that class three The only thing that composes a class is its first name and its attribute. This is what defines the prope
rties and methods of the object of the class. Let us simply understand as an example that we have named the class Student. We are declaring and we started the brace and closed the brace with this. Inside we will declare our tributes and the actions to be performed. Have to perform the operation, he will perform his operation, let's go to Babs. Sorry object side what is object object is a real time entity object You can consider anything so that you can create a set of related activities. The set
of activities that can be performed defines the objects that will perform. The behavior of our object and what type of object it is. These objects are instances of a class, meaning we can also say that an object is a Variable is type of object of class used to store data and some action. To perform, we use new keyword in the object. That means we created our object let's suppose we have a Is it a program or is there a class, there is a class named Person inside which we have placed our variable
s? Like name and its age, now we have to create its object, then we create object. To create it we will write a class and what will we name our object? We will decide the name, assign it with a new keyword and name our class. We will put the name where we will put our new keyword where we will decide our new keyword. This means that we have created an object of whatever class is behind it. Understand this, if I had two classes and I was in one person class and one There would be a Student class
and I would write Person and name an object equal to new. And after this, if I put student then my new keyword would be to check student. This means that at that time we would have meant that we declare class and we declare person. We are making a decided object, we are making an object of a person, but our He is becoming an object, he is becoming a student, okay? We will understand this thing later in the program but for now you should understand that Object is a real time entity and you can cr
eate any set of related objects from the object. The activity you can perform and the type of activity you will perform. With this we will tell the behavior of that object, now we will now move on to our next Let us move towards the pillar which is Encapsulation. Let us understand what is Encapsulation? But before that we have some examples which explain our real time entity. Okay, using this we will also understand our encapsulation but first you Understand about class and object, so let's supp
ose we have a mobile phone. What do we have in a mobile phone? You can denote it inside a class. You can like, what brand of mobile phone will we have, which brand and which type? Is it Android or iOS, what are its features and many more things It will have functions like what is the function of calling camera in a mobile phone? You can watch videos in it, you can read text in it, so let's Suppose we have a class named Mobile, now we have to create an object of it. What will we write to create o
bject? Name of mobile object is equal to new. Keyword and then mobile class, then through whatever object we have created, we You can call any of your functional camera watching video Next let us see that we have a bank, now what happens in a bank? In we have customers which have customer name account number It is their account type and many other information and their What are the functions? What is the behavior? Or can we credit or debit the amount? You can know the amount, know the loan type,
and inquire about the loan. You can take loan and many other things, so let's assume we have a bank. There is a class named inside which we have all these metrics of objects and we can access them. Okay, let's move on to our encapsulation, what is encapsulation? Encapsulation refers to the process of binding data members and their functions into To a single unit, it simply means that there is a process with the help of which You keep the data members and member functions in a single unit. Ok so
like. You understand, we have a class, it is any class, we just gave our example. The body of the Person class was the name of the person and its age, so you can understand that a class also It is these cups that include its data structure and its methods. And simply I told that encapsulation is a process of binding Which keeps data members and their functions in a single unit. Let us understand encapsulation better through an example like we We are talking about a concept with the help of whic
h you can combine data and its methods. Can operate in a single unit as is the case in any class in which the line What I am trying to convey is that you can interpret it in any way with the help of these captions. You can perform any operation by keeping data members and their functions in a single unit. When you perform encapsulation, it allows you to share your internal details. Hide means what methods did you perform in it, what actions did you perform and what did you enable? So you will hi
de it but the external feature you will actually show that through that action. You can always tell us what difference our program made and what results it brought. If you express then this is our encapsulation, encapsulation is a process Of binding data member and their function into single unit, let us also Moving to Visual Studio For those of you who don't know which one I am If I use tools then let me tell you that I use Visual Studio. Or we can say that whatever programming is done on our d
ot net is our visual Performs well in Studio and is basically done in Visual Studio only. Currently, you can also take help of Visual Studio Code and our own codes. Simple is a text editor for writing Visual Studio is a simple text editor To perform dot net application so I use this or all Developers use this if you need any reference on how to download What needs to be done then I will tell you about it in details or in short video. I will create it and tell you what the installation SD is, so
let's go. Let's start our program. First of all, we will select our properties. Ok so let's suppose I'm creating a class of mobile phone sorry friends first I have class Now I will create my properties inside it Encapsulates declared like brand done model done battery percentage and this Powered on we create a constructor the constructor until we create Till we know what are constructors, constructors are special types of classes. When you declare any class, its automatic constructor is created.
Here we have created our constructor in which we will pass in our two ansible classes. instantiating in the method itself So we were talking about the constructor. Constructor is special type of class when you create a class with the same name. The constructor also gets created. When the constructor is created, then It has no parameters but like it has default constructor but like Here I have passed parameters in the constructor which means this is our Constructor A parameterized constructor Ha
s constructor is also a copy constructor and is also a static constructor. Yes, but for now, just understand that we have created our constructor and In this constructor we have provided some parameters which are brand And this is where we treat our battery percentage value. Ok we have our battery percentage string which we should keep as integer The value of this power done by us is still false because we Initially, we are keeping the percentage of our battery at 100 and this is the power on ke
y. We are keeping the value false as initial value, now let us create a method. to power on the mobile Ok [Music] Only one method remains [music] We have made this method for power on and make the same for power off. [music] for [Music] Here we have this powered on value Let's create a method to make a phone call. Here we will demonstrate complete mobile phone functionality like how we How to call power on, off, off, battery percentage, battery called charge If we perform this type of functional
ity inside the class, then you understand that we have Now we have created a class inside which first we did some variables instead of that after that We have created some functions in it like power on power off, this is not functional. Constructor is let's create a function to make a fun phone call [music] Here we would like to denote some conditions for making a phone call. Let's assume that if Our mobile power is on and the battery percentage is greater than ours, not zero. It should be there
, if it is zero then the mobile should be switched off. Went [MUSIC] This [Music] If I decide the condition, if our battery If percentage is there then our phone will call, otherwise we will get error or message. To print the message, I have told you to print the message in C shape. print through right line are you Jung, did we assign any phone numbers to our program? was not did a [music]ja [music] j yo [music] J and [music] So we created a method called make a call in which we checked the cond
ition that if If it is powered on true and the battery percentage is greater than zero then it will call again. Wise will print an error or message You cannot make a call after charge charge your Phone After this we create a method called charge phone that if the phone brother is not charging If you want to charge then I will make another method for this. Am [music] [music] dio [Music] Jungle Di I have set a condition that if the power is off then only the charging message will come and the batt
ery will be charged. percentage 100 show Otherwise we will get the error 'Can't charge while phone is parked on' and That J [Music] [music] Declare some methods inside this And we also created a method called displayInformation so that we want to Whatever our result is, that output should be our print. Now go inside our class all of the things are declared inside one single Let us try to understand the unit. Now let us create an object of this class. [music] will do We created an object of mobil
e phone named M O O B. h and with the help of new keyword well in the object when I am telling the object So I told you that as soon as we use a new keyword, our The object is created at the same time and with whatever name we have given to it. It gets created but if whatever our class is behind it varies Like now our class is mobile phone so our mobile phone object is created. but look in this we have an error coming now let's see what the error is saying That our class that we have is paramete
rized, so see I have defined the class Created a constructor which was a parameterized constructor in which I had passed along its brand and model and kept the same information or value. Here I assign him [music] will do [Music] Look Our Error Now our mobile object has been created, now the help of this object will work. From this we can call whatever function or whatever method we want to call. watch comfortably I have made a display info call on this, now I will dial it and show it to you. [Mu
sic] Our debugger has arrived at our main method. See what's inside the class of which I created an object. I just saw that there are two parameters one is brand and one is mobile model I I had assigned a value to the brand, that value is being shown here and the model. The model assigned to me is also being shown. In other brands and models, the battery percentage was coming in our parameters. And whether the power is down or not, I have treated it here. [music] See, I went inside display info
and I put all those values ​​in my print line. Now if I look at its result, I will get this output. So friends, let's try to understand again. These are the encapsulations, I told that in these encapsulations we can store our data members and If their properties are kept in a single unit, then See what the mobile phone is doing here. This is what the mobile phone is doing here. is ours It has been obvious that we declared all our methods in the class named Mobile Phone. And whatever parameters o
f the methods we have assigned, all these are ours. If it is in a single unit, then its simple meaning is that these Encapsulation is a process with the help of which you can combine data members and Keep the function in a single unit and I also told you that the class The best example of encapsulation is that we all follow encapsulation in our code. Without encapsulation we cannot write our code and in the same way I created a mobile phone Create a class, from here you will also understand what
a class is. When we are creating a class, we put it in the class as we have told Told you that class composition means variables of different types. Our class is formed by properties and their combination. Class composes three. Things are named as classes and the operations performed in them are When we saw how to create an object of this class, then we With the help of new keyword we can create an object of class and with the With the help of object we can call all of its inside methods and fu
nctions. I have tried to explain object encapsulation to you in simple words. And its methods call further functions and methods through this object. Let's suppose I call now I like I just called display info now I check whether the power is on or off and how to make a phone call All Friends, first I gave this initial information. Had displayed now I am displaying the updated information here Let's see what results come from this program. Our object has become, we have displayed the information
of mobile phone, now here But if you go and check what information is there, then see the battery percentage. Brand and powered on or not and model information This is a mobile phone, it has been turned on. Let's see what information might have come on it. It became true, now I call mega phone, now I see what I have Information will be information is the same I have made make Some console dot right line was written in the call that it has to be printed, did it happen or not? We found out in our
results It will be ok now let us show our result so see we also have show in the result It's like in the first info Alir came to us and had some basic details but after That we have updated information printed So friends, this was our encapsulation where you saw that our The class was called Mobile Phone in which we had made its achievements as well. Many operations were also created, now all these operations and etc. The ribs were contained within a single class, that is, our encapsulation of t
he data. A single unit was wrapping its functions. So friends, this was our today's video in which we talked about class object and Next we will look at encapsulation, abstraction inheritance and polymorphism. Till then you watch this video. If you have any doubt then ask me and see you. Till then we are in the next video. Thank you

Comments

@anandparsad3700

Easy to understand

@BirdWing-vz9by

very informative.

@kmvidya1033

Well explained.

@kshitijrai1440

Very Good Explanation in very details,very helpful video for beginners .