VB编程中的风格指南与实践技巧
1. 面向对象设计自测题答案
首先来看一些面向对象设计的自测题答案示例。例如,有一个 MoveDown 方法的代码如下:
Public Sub MoveDown()
yCoordinate = yCoordinate + 10
End Sub
还有一个 Bomb 类的设计:
Class Bomb
Instance variables
xCoordinate As Integer
yCoordinate As Integer
height As Integer
width As Integer
yStep AS Integer
Methods
New
Move
Display
Launch
Properties
X As Integer
Y As Integer
Height As Integer
Width As Integer
另外,还有一些关于关系判断的答案,分别是 has-a 、 is-a 、 has-a 、 is-a 。
2. 编程风格的重要性
编程是一项极富创造性和趣味性的活动。然而,在实际的编程工作中,
超级会员免费看
订阅专栏 解锁全文
1245

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



