编程开发:自定义类与应用实践
1. 使用 Locals 窗口调试应用
在调试应用时,Locals 窗口是一个非常有用的工具。它允许我们查看对象的状态,确保应用程序正确执行。具体来说,Locals 窗口具有以下功能:
- 更改对象实例变量中存储的值。
- 查看当前作用域中的所有变量。
- 查看当前作用域中所有变量存储的值。
当变量的值发生改变时,在 Locals 窗口中它会变成红色。以下是一个简单的自我回顾问题及答案:
|问题|选项|答案|
|----|----|----|
|The Locals window allows you to…|a) change the value stored in an instance variable of an object
b) view all of the variables in the current scope
c) view the values stored in all of the variables in the current scope
d) All of the above|d|
|When a variable’s value changes, it becomes… in the Locals window|a) red
b) italic
c) blue
d) bold|a|
2. 创建自定义类
在之前的开发中,我们使用 .NET 类和方法为应用添加功能。现在,我们学习如何创建自己的类,即程序员自定义类,以提供 .NET 框架类库中没有的功能。Visual
超级会员免费看
订阅专栏 解锁全文

被折叠的 条评论
为什么被折叠?



