JAVA data types
1.byte: 1 byte
2.long: 8 bytes
3.char: 2 bytes
4.boolean: not discuss the number of bytes, regardless of 0/1, but ture / to false
5. The basic structure: public class TestDemo {
static void main public (String [] args) {
}
}
6. The output: System.out.printf ( "% d", 10) [ not]
System.out.println ( "") [LN Representative ENTER] [the System .out.println ( "Get value is:" + a);]
of System.out.print ( ""); [not ln, the output is not eNTER]
7. input: Scanner scanner = new Scanner (System.in ) ; [reference Scanner: Import java.util.Scanner;]
int = A scanner.nextInt ();
8. The random values: the random random new new = the random ();
int = A random.nextInt (bound: 5000) + 1'd; [ 1,5001) in value, bound is defined by the system, the digital output directly in the brackets, automatic pop-bound]
9.Java can still use ASCII, but actually use the Unicode character set
Type strong turn
int a=10;
byte b=a; //系统报错
强制转换:
int a=10;
byte b=(byte)a;
隐式转换: [byte 8;int 32;]
byte a=10;
int b=a;