1 向上转型(不需要强制转换): 由抽象度低的类向抽象度高的类转型(子类—父类) 好处:可以操作和使用子类继承或重写的方法 失处:失去对子类新增成员变量和新增成员方法的操作和使用 2 向下转型(需要强制转换): 由抽象度高的类向抽象度低高的类转型(父类—子类) 3 可以使用 引用变量 instanc ...
分类:
编程语言 时间:
2016-04-27 12:53:00
阅读次数:
154
函数中的作用域搜索顺序:L E G B L local,局部名字空间,即局部变量,在函数内部找 E enclosing,直接外围空间, G global,全局名字空间,即全局变量 B builtin,内建名字空间 ...
分类:
其他好文 时间:
2016-04-20 00:35:47
阅读次数:
136
最近在学设计模式,学到创建型模式的时候,碰到单例模式(或叫单件模式),现在整理一下笔记。 在《Design Patterns:Elements of Resuable Object-Oriented Software》中的定义是:Ensure a class only has one instanc ...
An image is represented by a binary matrix with 0 as a white pixel and 1 as a black pixel. The black pixels are connected, i.e., there is only one bla ...
分类:
其他好文 时间:
2016-03-31 12:42:37
阅读次数:
101
异常
在使用的时候,遇到了部分的异常,我用的是最新的Spring版本,Spring-4.2.5版本的,首先确保你的配置文件中引入了下面红色部分。
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instanc...
分类:
编程语言 时间:
2016-03-15 20:58:23
阅读次数:
364
最近在学设计模式,学到创建型模式的时候,碰到单例模式(或叫单件模式),现在整理一下笔记。 在《Design Patterns:Elements of Resuable Object-Oriented Software》中的定义是:Ensure a class only has one instanc
分类:
其他好文 时间:
2016-02-18 12:00:19
阅读次数:
150
闭包概念:Closure:内部函数中对enclosing作用域的变量进行引用enclosing作用域:函数内部与内嵌函之间范例1:#coding:utf-8def set_passline(passline): def cmp(val): if val>= passline: ...
分类:
编程语言 时间:
2016-01-25 11:24:40
阅读次数:
160
1.在Java中,类中的静态方法(特别是main方法)不能直接调用非静态方法。当编写内部类出现这样的编译错误:No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing in...
分类:
编程语言 时间:
2016-01-05 22:27:40
阅读次数:
223
今天在使用vue框架搭建环境时,遇到这个错误提示:[Vue warn]: Attribute "id" is ignored on component because the component is a fragment instanc这个提示的原因是使用 vue-router 和 vue-lo....
分类:
其他好文 时间:
2015-12-29 19:22:46
阅读次数:
1016
An image is represented by a binary matrix with 0 as a white pixel and 1 as a black pixel. The black pixels are connected, i.e., there is only one bla...
分类:
其他好文 时间:
2015-12-29 08:45:18
阅读次数:
133