Java Learning Note day09

Source: Internet
Author: User

The difference between break and continue:
Break is the end of this layer loop or used in a switch statement to end the current case;
Continue end this cycle
for (int i=0;i<9;i++) {
System.out.println (i+ "---------");
Break
}
The first cycle is over;
for (int i=0;i<9;i++) {
if (i=5) {
Continue
}
System.out.println (i+ "---------");
}
In the i==5, jump out of this cycle, and then loop on.

Array-Related:

Two special cases of arrays: length 0;
Two common exceptions to arrays: Index out-of-bounds exceptions and null pointer exceptions;

The static modifier is related to:

The This keyword cannot be used in a static method, because the static method belongs to the class, and this is the following object;

Static access is only static, access is direct access, calls are unrestricted, non-static can be accessed;
Static code block: Initializes the class and loads only once;

Execution order in program: Static code block--Construction code block--construction method
Static code block: Execute only once

Java Learning Note day09

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.