Chapter2.A Trip to Objectville.There will be objects.

来源:互联网 发布:冒险岛怎么升级v矩阵 编辑:程序博客网 时间:2024/05/22 14:28

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

  • A class is not an object.(but it’s used to construct them).
  • A class is a blueprint for an object.

The two uses of main:

  • to test your real class
  • to launch/start your Java application

类与对象的区别

  • 类不是对象(但类能构造对象)
  • 类是对象的蓝图

main的两个使用方式

  • 测试你写好的类
  • 运行你的Java程序