What's the best way to define the words “class” and “object” to someone who hasn't used them?

前端 未结 29 809
情话喂你
情话喂你 2020-12-13 05:11

My neighbor is taking \"Intro to Java\", and asked me to help explain a few of the first-day concepts. I realized that since I do this everyday, I don\'t have the beginner\

29条回答
  •  無奈伤痛
    2020-12-13 05:47

    Class teaches Objects how to behave. A class is a blueprint for an object. It tells the virtual machine how to make an object of that particular type. Each object made from that class can have it’s own values for the instance variables of that class. Example: You might use the Button class to make dozens of different buttons, and each button might have it’s own color, size , shape , functionality.

提交回复
热议问题