![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
HIT软件构造
Change_D
这个作者很懒,什么都没留下…
展开
-
软件构造笔记——java中的数据类型
Data type in programming languages1.1 Types and VariableTypes: A type is a set of values, along with operations that can be performed on those values.Variables: Named location that stores a val...原创 2019-06-16 20:00:53 · 130 阅读 · 0 评论 -
软件构造笔记——Type checking
Type checkingStatic checkingDynamic checkingThe bug is found automatically before the program even runs.静态检查针对类型,与变量特定值无关的错误。The bug is found automatically when the code is executed.动态检查怎对...原创 2019-06-16 20:12:55 · 583 阅读 · 0 评论 -
软件构造笔记——Mutability and Immutability
Mutability and Immutability1.1 Immutability(不变性)不变性是一种主要的设计原则,包括:Immutable types(不变数据类型):不变数据类型创建完后,值不可修改。Immutable references(不变引用):一旦指定引用位置,不可再次指定。final关键字对不可变类型提供了静态检查的支持:A final class d...原创 2019-06-16 20:17:31 · 228 阅读 · 0 评论 -
软件构造笔记——可变性的危害
Risks of mutationRisky example #1:passing mutable values以下为一个计算list中各数之和的方法:/** @return the sum of the numbers in the list */public static int sum(List<Integer> list) { int sum = 0; ...原创 2019-06-16 20:18:57 · 260 阅读 · 0 评论 -
转载:java中成员变量和局部变量在内存中的分配
对于成员变量和局部变量:成员变量就是方法外部,类的内部定义的变量;局部变量就是方法或语句块内部定义的变量。局部变量必须初始化。 形式参数是局部变量,局部变量的数据存在于栈内存...转载 2019-06-17 11:21:43 · 1105 阅读 · 1 评论 -
软件构造笔记——OOP(面向对象编程)
面向对象编程的几个基本概念Object拥有一组状态(statestatestate,即fieldsfieldsfields)和行为(behaviorbehaviorbehavior,即methodmethodmethod)。Classes每一个对象都有一个类用来描述其状态和行为,其中MethodsMethodsMethods和fieldsfieldsfields统称为membersmemb...原创 2019-06-24 20:20:54 · 241 阅读 · 0 评论