Last active
September 21, 2024 19:01
-
-
Save julienetie/5027d67b5e308552ce6f724eb2317f6b to your computer and use it in GitHub Desktop.
Structs vs Classes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Language | Inheritance | Encapsulation | Polymorphism | Constructors | Static Members | Multiple Inheritance | Method Overriding | Method Overloading | |
---|---|---|---|---|---|---|---|---|---|
C struct | ❌ | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | |
C class | NA | NA | NA | NA | NA | NA | NA | NA | |
C++ struct | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |
C++ class | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |
C# struct | ❌ | ✅ | ❌ | ✅ | ✅ | ❌ | ❌ | ✅ | |
C# class | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | |
Swift struct | ❌ | ✅ | ❌ | ✅ | ✅ | ❌ | ❌ | ✅ | |
Swift class | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | |
Zig struct | ❌ | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | |
Zig class | NA | NA | NA | NA | NA | NA | NA | NA | |
Rust struct | ❌ | ✅ | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ | |
Rust class | NA | NA | NA | NA | NA | NA | NA | NA | |
Go struct | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | |
Go class | NA | NA | NA | NA | NA | NA | NA | NA | |
Odin struct | ❌ | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ | ✅ | |
Odin class | NA | NA | NA | NA | NA | NA | NA | NA | |
D struct | ❌ | ✅ | ❌ | ✅ | ✅ | ❌ | ❌ | ✅ | |
D class | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | |
V struct | ❌ | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | |
V class | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | |
Nim struct | ❌ | ✅ | ❌ | ✅ | ✅ | ❌ | ❌ | ✅ | |
Nim class | NA | NA | NA | NA | NA | NA | NA | NA |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment