44 AnswersNew Answer
Try a bunch of OOP courses on DataCamp, Coursera or right here. Multiple tutorials are on the Play Store as well.
You do not have to use classes - just go functional programming and do your best as, perchance, OOP is not for you. Try to get on with Machine Learning and Data Science then.
Ore Nice run through of the high level talking points for class based and prototypal based inheritance / OOP. \•/ It's always nice to meet a fellow veteran programmer here who has also been working with Java since it was released - or shortly thereafter. 👌 jack I completely agree that, in C#, pretty much everything is an object. Even the equivalent of Java primitive types are actually value types in C#, which inherit from System.Object like everything else in the CLR. C# also supports delegates, which is basically the class equivalent for defining function types. Kotlin is the closest to C# of the statically typed languages in these regards. For those who want to really bend your minds with some cool C# Voodoo black magic, check out this code I created for another question where I demonstrate the ability to create class properties at runtime on demand. This code also uses explicitly typed properties inherited from an abstract class and other classes. https://code.sololearn.com/c0KhE05NCS76/?ref=app
There is way more to oop than i mentioned above. If you're really interested in learning oop i suggest to invest money in a propper book or two. And i dont mean clean code and such. Start with the basics do projects and repetition, repetition, repetition. You'll eventually get there. P. S. Unlike the others i won't suggest to watch any youtube videos on oop. The topic ( as is common in programming) is so vast that you can't comprehend whats happening from watching some videos. My expirience is that you get even more confused because people tend to do things very different and dont explain everything in the detail you need, to make sense out of it. You end up like a monkey typing code you dont understand, because you lack the basics. If you watch videoes on YouTube choose the ones that try to explain a certain problem, not a topic or a whole idea.
Lothar I got confused with concept of classes ,encapsulation,polymorphism, inheritance and their syntax look a bit hard to understand can you please explain me the concept of Object Oriented Programming easily . I learnt OOP in Sololearn w3schools also but I am stil confused with its syntax.they look so vast😱😨
Maybe because it's more complex than procedural programming.
Just think of the class as being a place to put all the ingredients like properties and methods needed for your object. Once you have done this you will have to create an object from it, the object is like a self contained usable version of the class that contains all the ingredients for you to use. If you create 2 objects of the same class both objects are seprate from one another just like in real life when you see 2 identical cars which look the same but you know there 2 separate objects that have there own properties ie one car gets damaged but the other is intact.
Have you gone through the Python or Java course herein?
PART 3 ====== Polymorphism: The ability of a class to produce objects of different form. Constructor: A function that describes actions to be performed when a object of a specific type is created. Destructor: A function describing actions to be performed when an object lifecycle has expired. There are so many other terms. It will be wise to seek a good tutorial on this subject. But hopefully this is a good introduction.
Arnav Kumar PART 1 ====== OOP is a complex paradigm that I can not explain completely here. I hope to just give an introduction and leave you to learn it yourself somewhere else. The whole idea of object oriented programming is to encapsulate related data into small objects. These small objects have their attributes and methods with which they interact with other objects in unique ways. The interaction between several of these related objects make up the bigger picture. An analogy: The real world is full of many objects, both living and non-living. These objects exist independently and have their own internal state some of which may not be accessed directly by an external medium. But these objects interact with each other to produce the bigger picture. That is what OOP feels like. About the connection between JS and Java objects: They are similar but not exactly the same. ....will continue in another response
Ya I have completed java kotlin c++ and python without understanding OOP and just ignored them
Public means as much as other parts oth your programm can see this property or method as well. Private means just the opposite, only members of this class can see methods and property so they wont be accessible in other classes. Void is a return parameter that defines that a method ( js the equivalent would be function) has no return therefore the keyword return is not valid with any return type ( can still be used to exit the function) Protected is much like private except that its visible to derived classes ( Inheritance) Internal is only visible with in you application/ programm. Virtual makes classes available to be overridden using the override key word. Most commonly ToString() method in c# is overridden to adjust the string output ( i doubt your user wants to know the type of class youre using so you have to adjust output) Thats that in short
Arnav Kumar You do not need to have a glossary while learning. As you learn, you will discover new things and understand new terms gradually.
Arnav Kumar Java and C++ support OOP well enough. Python is definitely lacking some core features. I don't know about Kotlin. I would say start with Java because it is easy compared to C++ or Python.
But I want to learn oop!
Kirabo Ibrahim no it's syntax can you help me with that
D_Stark I know how classes and object relate to real life objects Can you please help me with the code syntax of classes and objects and keywords used in them