Pergunta de entrevista da empresa Google

What is the difference between a class and a struct?

Resposta da entrevista

Sigiloso

17 de jan. de 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.