Question d’entretien chez Google

What is the difference between a class and a struct?

Réponse à la question d'entretien

Utilisateur anonyme

17 janv. 2013

A struct is very similar to a class, but the key difference is how the info is accessed. Struct is defaulted to public, and Classes are default private. Classes are a major part of OOP, because they provide a layer of abstraction to protect and validate interactions with the data.