Domanda di colloquio di Google

What is the difference between a class and a struct?

Risposta di colloquio

Anonimo

17 gen 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.