Java beginners and java beginners

Source: Internet
Author: User

Java beginners and java beginners

1. jdk (java Development Kit) ------> jre (java Runtime Environment) ------> jvm (java Virtual Machine)

------> Application (javac)
-------> Java API (Util)
2. java running process:
. Java source file -------- javac (Compiled) ------->. class ---------> (java command jvm) Description --------> operating system output
3. Configure environment variables:
Download jdk (csdn, linux community version 1.6-1.8)
4. public static void main (String [] args) {} All java program entries

 


5. identifier: Something about the name in java 1. class Name: the first letter is in upper case. It cannot start with a number. It cannot use java key words (Reserved). It can contain letters, numbers, _, $. It must be meaningful, camper (when two or more words constitute a name, each letter is capitalized)
2. variable name: cannot start with a number, cannot use java key (Reserved) Words, can use letters, numbers, _, $, to make sense, camper (when two or more words constitute a name, each letter is capitalized)
6. Variable: data type variable name = value;
Int num = 10;

Data type variable name;
Variable name = value;

7. operator: +,-, *,/, %, ++, --, + = ++, add 1 before assignment, after that, assign the value to the variable and then 1. All sums are for example: + =
8. logical operators: >,<,>=, <=, ||,&,=( equal ),! = (Not equal)
9. if (condition ){}

 

10. Select the structure: if three-object operator (condition? Real results: false results)
If (condition ){
Code blocks;
} Else {
Code blocks;
}


If (condition ){
Code blocks;
} Else if (condition ){
Code blocks;
} Else {

}
Switch (num ){
Case 1:
Code blocks;
Break;
Case 2:
Code blocks;
Break;
Case 3:
Code blocks;
Break;
Default:
Code blocks;
Break;

}
Loop Structure:

While (loop condition ){
Code blocks;
}

Do {
Code blocks;
} While (Cyclic condition );

// Do while will execute the content in do again no matter what the conditions are. while will execute the loop only when the conditions are met.

For (initialization variable; loop condition; increment or decrease variable ){
Code blocks;
}

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: info-contact@alibabacloud.com 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.