抽象类为基类:abstract class Animal { string name; public string Name { get { return name; } set { name = value; } } char gender; public char Gender ...
分类:
其他好文 时间:
2014-07-19 21:30:18
阅读次数:
182
There’s a convention on how to name a method, which is to be considered the constructor of the class. Classes inherit from other classes. There’s acce...
分类:
编程语言 时间:
2014-07-17 12:54:15
阅读次数:
255
getResourcesAsStream()来读取.properties文件,但是getResourcesAsStream()仅在java项目时能获取根目录的文件;在web项目中,getResourcesAsStream()是获取classes目录的根路径例如:文件在WEB-INF/conf/con...
分类:
编程语言 时间:
2014-07-17 11:19:57
阅读次数:
201
代码文件:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ComCtrls;type TForm1 = cla...
分类:
其他好文 时间:
2014-07-16 19:23:58
阅读次数:
277
1、 方法重载与覆盖的区别?(Overload与Override的区别)2、 String 和StringBuffer的区别3、 字符串“abcde”通过写一个函数不让调用第三方的字符串,实现一个字符串倒序,比如字符串“abcde”变成“edcba”.4、 抽象类与接口的区别(abstract与in...
分类:
移动开发 时间:
2014-07-16 17:51:43
阅读次数:
276
1. 虚函数和纯虚函数可以定义在同一个类(class)中,含有纯虚函数的类被称为抽象类(abstract class),而只含有虚函数的类(class)不能被称为抽象类(abstract class)。 2.虚函数可以被直接使用,也可以被子类(sub class)重载以后以多态的形式调用,而纯虚函数...
分类:
编程语言 时间:
2014-07-16 17:05:43
阅读次数:
244
CComponent:path:framework/base/CComponent.phpoverview:This file contains the foundation classes for component-based and event-driven programming. ...
分类:
其他好文 时间:
2014-07-16 16:03:00
阅读次数:
180
APK文件结构
APK文件实际是一个zip压缩包,可以通过解压缩工具解开。
下面是用解压缩工具解开的APK包的结构:
|-- AndroidManifest.xml
|-- META-INF
| |-- CERT.RSA
| |-- CERT.SF
| `-- MANIFEST.MF
|-- classes.dex
|-- res
| |-- dr...
分类:
其他好文 时间:
2014-07-16 12:50:17
阅读次数:
234
1.virtual 函数版本
class GameCharacter{
public:
virtual int healthValue() const; //返回人物的健康指数, derived classes 可重新定义它
};
2.使用 non-virtual interface 手法,那是 Template Method 设计模式的一种特殊形式。
让客户通过 public non-virtual 成员函数间接调用 private virtual 函数
class GameCharacter{
pu...
分类:
编程语言 时间:
2014-07-15 22:36:18
阅读次数:
364
经验:Templates 生成多个 classes 和多个函数,所以任何 template 代码都不该与某个造成膨胀的 template 参数产生相依关系
因非类型模板参数(non-type template parameters) 而造成的代码膨胀,往往可消除,做法是以函数参数或 class 成员变量替换 template 参数
示例:
template //size_t 是非类型模板参数
class SquareMatrix{
public:
//...
分类:
编程语言 时间:
2014-07-15 13:04:39
阅读次数:
307