版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u011733020/article/details/85645439
1.对象的创建通过new 关键字来完成。
2.对象类型 用class 表示。
3.类中可以有 变量和方法,变量有静态变量和普通变量的区别,方法有返回值类型。
4.类、变量、方法的命名规范遵循驼峰式,类命名首字母大写,变量和方法的命名首字母要小写。
class AllTheColorsOfTheRainbow {
int anIntegerRepresentingColors;
void changeTheHueOfTheColor(int newHue) {
// ...
}
// ...
}