What are the similarities between structs and classes? (Select all that apply)
Need help with C++ Work
Similarities Between Structs And Classes are given below :-
1. Access specifies, such as public, private, and protected, are identically used in structures and classes to restrict the access of their data and methods outside their body.
2. The access level for class members and structs members, including nested classes and structs, is private by default. Private nested types are not accessible from outside the containing type.
3. Both can have constructors, methods, properties, fields, constants, enumerations, events, and event handlers.
4. Both structures and classes can implement interfaces to use multiple-inheritance in code.
5. Both structures and classes can have constructors with parameter.
6. Both structures and classes can have delegates and events.
Step by step
Solved in 2 steps