Finally Understand Class/Structure

Weifan Zhou / 2023-02-22


I did not fully understand "Class" until this weekend I used code cademy and learned about structure. I was confused whether Class is like std or a type like int (I was thinking how types are defined). Now I know it's a datatype. And I realized why private and public are needed. Probably, for safety reasons, the developer doesn't wanna users to revise data, such as deposits, to be a billionaire (lol).

Added: after learning linked lists, I have some new ideas. I don't like to name "class" or "structure" as how it being named but call it "mold". By adding different colors or materials, different products are made, and that's why those products are called "object" (in my perspective). I don't think "car" or "student" are perfect examples for programming beginners.

Last modified on 2023-02-22