Some points to be aware of when learning Java Basic grammar

Source: Internet
Author: User
The following points should be noted when writing Java programs:
  • Case-sensitive: Java is case-sensitive, which means that the identifier Hello is different from hello.
  • Brackets: Match any parentheses! Suggestion: The parentheses are written in pairs, and if deleted, the pairs are deleted.
  • Indentation: Proper attention to the indentation of the code increases the visibility of the code.
  • Symbol: When writing code, all symbols must be in the English half-width symbol input. At the same time, the end of each sentence execution code must end with a semicolon.
  • Line break: Proper attention to line breaks increases the visibility of your code.
  • Guide Package: You can import the corresponding tool class to assist the development.
  • Class name: For all classes, the first letter of the class name should be capitalized. If the class name consists of several words, the first letter of each word should be capitalized, such as Myfirstjavaclass.
  • Method Name: All method names should start with a lowercase letter. If the method name contains several words, the first letter of each subsequent word is capitalized.
  • Source file name: The source file name must be the same as the class name. When saving the file, you should use the class name to save the filename (remember that Java is case-sensitive), and the suffix of the file name is. java. (a compilation error is caused if the file name and the class name are not the same).
  • Main method Entry: All Java programs are executed by the public static void Main (String[]args) method.

Some points to be aware of when learning Java Basic grammar

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.