Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Hazarth95376ywithout *any* examples? hmm... well it wont be understandable by a child but
classes are extendable data structures with integrated functionality that operates on top of the data they define
objects are in-memory instances of classes
interesting question, I'll give that some more thought in my next shower -
@Hazarth Great. I have been using examples when talking about classes and objects in my entire career. I also learned like that. So I was wondering what devs around here got to say about this
-
Classes are blueprints for objects. Objects are implementations of those blueprints, stored in heap.
Classes define object's structure, constant values, functions. Objects cannot have any additional properties, not defined by the classes they are made by. Objects are sort of copies of their classes, filled with dynamic data.
Classes define interactions between objects. Objects interact as defined by classes -
@netikras ...unless you're in Salesforce land, in which case classes are just something that's always written in Apex, objects are the equivalent of custom database tables, instances of Apex classes don't even have a name =)
-
@mundo03 Classes aren't really groups of objects. That sounds much more like a description of a collection.
-
mundo0349115y@AlmondSauce a collection is a data type that can in fact hold objects, and even classes.
But in language agnostic OOP, classes are templates to create objects, maybe I made it too simple.
Related Rants
Simply explain class and objects without examples
question
headache
work
life
insomnia