Playing around with Swift, coming from a Java background, why would you want to choose a Struct instead of a Class? Seems like they are the same thing, with a Struct offeri
Structure and class are user defied data types
By default, structure is a public whereas class is private
Class implements the principal of encapsulation
Objects of a class are created on the heap memory
Class is used for re usability whereas structure is used for grouping the data in the same structure
Structure data members cannot be initialized directly but they can be assigned by the outside the structure
Class data members can be initialized directly by the parameter less constructor and assigned by the parameterized constructor