Home > Back-end >  Java study notes
Java study notes

Time:01-21

Basic syntax
? The name of the class: for all the classes, the class name of the first letter should be capitalized, if the class name consists of several words, then the first letter of each word should be capitalized, MyFirstJavaClass, for example,
? The method name: all method names should begin with a lowercase letter, if the method name contains a number of words, is the back of the capitalize the first letter of each word
? Source file: the source file name must be the same and the name of the class, when saving files, you should use the name of the class as a filename to save (remember that Java is case sensitive), and the filename suffix for. Java, (if the file name and the name of the class is not the same, would cause a compiler error),
Java identifier
Java all parts need name, the name of the class, the variable name and method name called identifier,
On Java identifier, there are the following points need to pay attention to:
? All identifiers should be with A letter (a-z or a-z), the dollar sign ($), or an underscore (_)
? After the first character can be any combination of the characters
? Keywords cannot be used as identifiers
? Identifiers are case sensitive
Java variable
Mainly has the following several types of variables in Java
? The local variable
? Class variables (static)
? Member variables (non-static variables)
Built-in data type
Basic types: 8 byte binary digits:
Packing: Java. Lang. Byte
Minimum: Byte.MINVALUE=https://bbs.csdn.net/topics/-128
Max: Byte.MAX_VALUE=https://bbs.csdn.net/topics/127

Basic types: short of binary digits: 16
Packing: Java. Lang. Short
Minimum: Short.MIN_VALUE=https://bbs.csdn.net/topics/-32768
MAX: Short. MAX VALUE=https://bbs.csdn.net/topics/32767

Basic types: int the binary digits: 32
Packing: Java. Lang. Integer
Minimum: Integer. MIN VALUE=https://bbs.csdn.net/topics/-2147483648
Max: Integer.MAX_VALUE=https://bbs.csdn.net/topics/2147483647

Basic types: 1 ong binary digits: 64
Wrapper classes: Java. 1 ang. Long
Minimum: Long.MINVALUE=https://bbs.csdn.net/topics/-9223372036854775808
Max: Long.MAX_VALUE=https://bbs.csdn.net/topics/9223372036854775807

Basic types: f1oat binary digits: 32
Packing: Java. Lang. Float
Minimum: F1oat. MIN VALUE=https://bbs.csdn.net/topics/1.4E-45
Max: F1oat.MAXVALUE=https://bbs.csdn.net/topics/3.4028235E38

Basic types: double binary digits: 64
Packing: Java. Lang. Double
Minimum: Double. MIN VALUE=https://bbs.csdn.net/topics/4.9E-324
Max: Double.MAX_VALUE=https://bbs.csdn.net/topics/1.7976931348623157E308

Basic types: char binary digits: 16
Packing: Java. Lang. Character
Minimum: Character. MIN VALUE=https://bbs.csdn.net/topics/O
Max: Character.MAXVALUE=https://bbs.csdn.net/topics/65535
Hexadecimal number
Hex:
Hex (abbreviated as hex or subscript 16) in mathematics is A kind of 16 into 1 carry on the system, the general use Numbers 0 to 9 and the letters A to F (or A ~ F case-insensitive (letter), said: A ~ F 10 ~ 15, called hexadecimal digits,
The decimal system:
Decimal in mathematics is a kind of every 10 to 1 carry system, general use Numbers 0 to 9 (0,1,2,3,4,5,6,7,8,9) count by ten, said

Octal:
Octal in mathematics is a kind of meet eight into a binary system, general use Numbers 0 to 7 (0,1,2,3,4,5,6,7) number eight, said
Binary:
Binary in mathematics is a kind of take into a binary system, it contains only 0, 1 two Numbers, every 0 or a 1, is called a bit (bit),
  • Related