- Beginning C# 7 Hands-On:Advanced Language Features
- Tom Owsiak
- 132字
- 2021-07-02 15:29:18
Chapter review
For review, the complete version of the Default.aspx.cs file for this chapter, including comments, is shown in the following code block:
//using is a directive
//System is a name space
//name space is a collection of features that our needs to run
using System;
//public means accessible anywhere
//partial means this class is split over multiple files
//class is a keyword and think of it as the outermost level of grouping
//:System.Web.UI.Page means our page inherits the features of a Page
public partial class _Default : System.Web.UI.Page
{
protected void Button1_Click(object sender, EventArgs e)
{
int x = 25, y = 34;//declare and set two variables
sampLabel.Text = $"x={x}, y={y}";//display variables
GenMethods.Swap (ref x, ref y);//swap values
sampLabel.Text += $"<br>x={x}, y={y}";//display swapped values
sampLabel.Text += GenMethods.Compare (x, y);
}
}
推薦閱讀
- 極簡算法史:從數(shù)學(xué)到機器的故事
- .NET之美:.NET關(guān)鍵技術(shù)深入解析
- jQuery Mobile Web Development Essentials(Third Edition)
- Python數(shù)據(jù)分析基礎(chǔ)
- Full-Stack React Projects
- Mastering JavaScript High Performance
- Nginx實戰(zhàn):基于Lua語言的配置、開發(fā)與架構(gòu)詳解
- Visual Basic程序設(shè)計習(xí)題與上機實踐
- Hands-On Nuxt.js Web Development
- Arduino Wearable Projects
- IPython Interactive Computing and Visualization Cookbook
- Machine Learning for OpenCV
- 數(shù)據(jù)科學(xué)中的實用統(tǒng)計學(xué)(第2版)
- 例解Python:Python編程快速入門踐行指南
- C語言從入門到精通(視頻實戰(zhàn)版)