Java Learning Tutorial code block

Source: Internet
Author: User

Learn to program the Java Learning Tutorial code block published, welcome to visit through the xuebiancheng8.com

The code blocks in Java include the following:

1. Common code Blocks

2. Building code Blocks

3. Static code block

1. Common code block is very simple to see the following example:

public class test{

public static void Main (String args[]) {

{//This is a normal block of code, and the code in the normal code block executes sequentially

System.out.println ("Hello");

}

}

}

2. Building code Blocks

public class test{

{

System.out.println ("Here is the construction code block, executed before executing the construction method");

}

public static void Main (String args[]) {

}

}

3. Static code block

public class test{

static{

System.out.println ("Here is a static block of code that executes when the test class is called, first constructs a block of code and constructs a method of execution");

}

}

The above is a few blocks of code in Java, more information can be accessed through xuebiancheng8.com

The specific URL is

Http://xuebiancheng8.com/play/goodgoodstudy_133_daydayup.html


Java Learning Tutorial code block

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.