Lingdingyang

Stay Hunger, Stay Foolish

Want to be a generalist, able to take on a wide variety of different work.


Java Tutorial Note.1

Java 的语法与 C++、C# 还是有许多类似的,先记录一下目前觉得要注意的地方。

命名

  • For all class names, the first letter should be in Upper Case.
  • All method names should start with a Lower Case letter.
  • Name of the program file should exactly match the class name.

代码结构

  • There can be only one public class per source file.
  • A source file can have multiple non public classes.
  • The public class name should be the name of the source file as well which should be appended by .java at the end.

其他

enums can be declared as their own or inside a class. Methods, variables, constructors can be defined inside enums as well.

There is no default value for local variables so local variables should be declared and an initial value should be assigned before the first use.

A variable or method declared without any access control modifier is available to any other class in the same package. The fields in an interface are implicitly public static final and the methods in an interface are by default public. Methods declared without access control (no modifier was used) can be declared more private in subclasses.

最近的文章

Devexpress Chart Note

关于 Devexpress 中 Chart 的一些记录。

windows.net继续阅读
更早的文章

How to Take Notes

如何把笔记类APP用好,变成系统性的知识管理工具?Link

study继续阅读