1.普通工厂模式package CommonFactory;public class Test {
public static void main(String[] args) { VehicleFactory factory = new
CarFactory(); ...
分类:
其他好文 时间:
2014-04-28 04:46:43
阅读次数:
427
//: WIND2.CPP -- Inheritance &
upcasting#include enum note { middleC, Csharp, Cflat }; // Etc.class instrument
{public: void play(note) const { // ...
分类:
其他好文 时间:
2014-04-28 01:35:42
阅读次数:
1272
ArrayList:public class ArrayListextends
AbstractListimplements List, RandomAccess, Cloneable, SerializableList
接口的大小可变数组的实现。实现了所有可选列表操作,并允许包括 null 在内的...
分类:
编程语言 时间:
2014-04-28 01:31:46
阅读次数:
834
委托与事件废话一堆:网上关于委托、事件的文章有很多,一千个哈姆雷特莎士比亚就有一千个莎士比亚,以下内容均是本人个人见解。1. 委托1.1 委托的使用
这一小章来学习一下怎么简单的使用委托,了解一些基本的知识。 这里先看一下其他所要用到的类的信息 /// /// 函数用例 /// public...
分类:
其他好文 时间:
2014-04-28 00:58:29
阅读次数:
435
本人有一段代码关于"~"运算符 public class m{ public static
void main(String[] args){ int x=~5; System.out.println(x); ...
分类:
其他好文 时间:
2014-04-28 00:48:41
阅读次数:
326
对于类而言,为了让使用者获取它自身的一个实例,最常见的方法就是提供一个公有的构造器。但是有一种方法,他就是静态工厂方法(static factory
method),它只返回类的实例的静态方法。比如说我们所有的基本类型的封装类中的valueOf()方法1 public static Boolean ...
分类:
其他好文 时间:
2014-04-28 00:34:52
阅读次数:
452
//: ORDER.CPP -- Order of constructor calls // with
inheritance#include #define inherit(derived, base) \class derived : public base
{ \public: \ deri....
分类:
其他好文 时间:
2014-04-28 00:09:24
阅读次数:
444
#include class base {public: virtual void v() const
= 0; virtual void f() const = 0 { // 纯虚函数也有实现内容,但子类仍然必须实现这个虚函数 cout <<
"base::f()\n"; }};voi...
分类:
其他好文 时间:
2014-04-27 23:47:48
阅读次数:
561
□ 只读属性public class Example { string name; public
string Name { get {return name;} } }□ 只写属性public class Example { string ...
分类:
其他好文 时间:
2014-04-27 23:34:03
阅读次数:
507
对于在线的繁忙业务表的任何操作都可能带来意想不到的风险。一张业务表,对partition
key进行升位,其步骤是:rename原表新建临时表交换分区到临时表升位临时表的字段的长度交换临时表到第二张临时表rename第二种临时表为业务表整个的操作过程如果顺利,预计在10s左右,如果放在文件中,速度会...
分类:
数据库 时间:
2014-04-27 22:32:31
阅读次数:
776