What's the difference between a class and an object?

What's the difference between a class and an object?

instance variables: Things an object knows about itself

methods: Things an object can do

A class is not an object, but it's used to construct them.

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 its own values for instance variables of that class, For example, you might use the Button class to make dozens of different buttons, and each button might have its own color, size, shape, label, and so on.

上一篇:CentOS7与Win7双系统引导问题


下一篇:Difference between jQuery.extend and jQuery.fn.extend?