day 03 Java basic grammar

Java annotations

  1. Single-line comments // (comment only line of text)
  2. Multi-line comments / ** / (Enter the text between two asterisks, you can annotate a text)
  3. Documentation comments / ** (two asterisks in front, followed by an asterisk, you can enter text in between them)
    * /

Identifier

  • Keyword

All components of Java requires name, class names, variable names and method names are called identifiers.

important point

  1. All identifiers should be in uppercase or lowercase letters (AZ or az), the dollar sign ($), or an underscore (_) begins.
  2. After the first letter can be uppercase or lowercase letters (AZ or az), the dollar sign ($), or an underscore (_) characters, or any combination of numbers.
  3. You can not use keywords as variable or method name.
  4. Identifiers are case sensitive
  5. Legal identifier, for example: age, $ salary, _value, _ _1_value
  6. Illegal identifier example: 123abc, -salary, # abc
  7. Or you can use Chinese pinyin name, but is not recommended

type of data

  • Strongly typed language
    requires the use of variables to strictly comply with the provisions, in order to use all the variables must be defined

  • Weakly typed language

Java belong to a strongly typed language

  • java data types into two categories
  • Basic types of
    Here Insert Picture Description
    bits (bit) is the smallest unit of computer storage.
    Byte (byte) is generally expressed by the capital letter B
    characters: refer to a computer with letters, numbers, characters, symbols.

1B=8b
1024B=1KB
1024KB=1M
1024M=1G
1024G=1TB

Here Insert Picture Description

  • Note that
    long after the digital input to the L +
    float to its input after the decimal F +
    String is not a keyword

  • Reference types

Released four original articles · won praise 0 · Views 104

Guess you like

Origin blog.csdn.net/Hjiayou/article/details/105137156