Head A C # Chinese version chapter II page66

Source: Internet
Author: User

Start coding the real job of any program is to write instruction statements. But the statement does not exist in a vacuum. So we started digging into it and writing code. Create a new Form Application project.

Add a directive statement to display a message to start by double-clicking the first button. Then add the following six instruction statements to the Button1_Click () method. Look at the code closely and see its output.

Syntax 101

*每行代码都是分号结尾
x=x+1;
*注释以双斜线开始
//this line is ignored
*大多数空格都无所谓
x = 3;与x=3;一样
*变量声明时都有类型和名字(第四章你会学习很多的类型)
int weight;
//weight is an integer
*类和方法定义时都有大括号
public void go()
{
//amazing code here
}

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.