The first chapter: 1. What's in Java?
The JDK (Java Development Kit) includes
Jre (Java Runtime Environment)---------->JVM (Java Virtual machine)
Application (JAVAC)
Java API and some common jar packages;
- Java benefits: A. Object-oriented; cross-platform/portability for B.java;
- Java execution Process: Java source file-------> Compiler-------->.class file--------->JVM explained.
Chapter II:
Variable:
Use a single letter or character to express words. The first thought of char;
String name = "Zhang San";
String name;
Name = "Zhang San";
int age = 18;
int age;
Age = 18;
char sex = ' male ';
char sex;
sex = ' woman '
mathematical operators +;-; *;/;%;+=; + +;--;
+ = is
sum = sum+ (num1+num2) is equivalent to sum+= (NUM1+NUM2)
Logical operator:>; <; >=; <=; !=; = = (two equals equals an equal sign is an assignment).
|| ;&&;
|| : Two conditions, meet one can be run;
&&: Two conditions are met to run.
identifiers :
- Can contain numbers, letters, (_ and $ are not recommended for use);
- Cannot begin with a number;
- Cannot use Java keywords;
- to have meaning;
- Hump naming law;
- Capitalize the first letter of the class name;
Chapter III:
- Select structure: if structure; switch structure
- A simple if statement:
If (condition) {
Statement
};
If.......else statements
If (condition) {
}else{
};
If.......else if........else Statements
If (condition) {
}else if (condition) {
}else{
};
switch (expression) {
Case Value:
Break
Case Value:
Break
Case Value:
Break
Doufault:
break;
}
Loop structure:
While do........while for
For loop (fixed for loop count)
for (int i = 0; i< 10; i++) {
}
While is typically used in cases where the number of cycles is unknown;
Summary of the first three chapters of Java