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

前端 未结 29 875
情话喂你
情话喂你 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:40

    If they are learning to program OO have them use BlueJ. They should get the differences after walking through the first tutorial.

    You define the classes and when you instantiate them they actually appear at the bottom of the GUI at which point you can call methods on them.

    It really helps get the point through better than any analogy you want to try. Even if you nail the analogy, it doesn't translate into code for someone who hasn't learned OO yet (even though for all of us it seems really natural and all these descriptions make great sense.)

提交回复
热议问题