【创建型】1、单例模式(Singleton Pattern) 2、工厂方法模式(Factory Method Pattern)3、抽象工厂(Abstract Factory Pattern)4、建造者模式(Builder Pattern) 5、原型模式(Prototype Pattern) 【结构型...
分类:
编程语言 时间:
2014-06-25 21:18:34
阅读次数:
247
Collections.sort 异常
java.lang.IllegalArgumentException: Comparison method violates its general contract!
at java.util.TimSort.mergeHi(TimSort.java:868)
at java.util.TimSort.mergeAt(Ti...
分类:
其他好文 时间:
2014-06-25 19:47:27
阅读次数:
250
Chapter1 and Chapter2方法定义:def methodName(param1: ParamType, param2: ParamType2, [maybe more]): ReturnType = { // method body}函数式编程中一个约定俗成的说法就是,方法会返回一....
分类:
其他好文 时间:
2014-06-25 19:15:35
阅读次数:
205
创建型: 1. 单件模式(SingletonPattern) 2. 抽象工厂(AbstractFactory) 3. 建造者模式(Builder) 4. 工厂方法模式(Factory Method) 5. 原型模式(Prototype)结构型: 6. 适配器模式(AdapterPattern)...
分类:
其他好文 时间:
2014-06-25 18:16:08
阅读次数:
148
/**
* Method 1: Delete the input element x
* and meanwhile keep the length of array after deleted n
* @param a the array
* @param n the length of array after deleted.
* @param x the element t...
分类:
其他好文 时间:
2014-06-25 08:27:27
阅读次数:
171
(1) abstract方法没有具体的实现,同时必须被覆写
(2) 虚(Virtual)方法可以没有具体的实现,也不一定必须覆写(虚方法定义时,可以没有具体的实现代码,但是必须创建方法体:即必须有方法的左右花括号)。
(3) 抽象方法不可以使用base.method()方式调用,但是虚方法是可以的
//定义一个抽象方法
using System;
using System.Colle...
分类:
其他好文 时间:
2014-06-24 22:21:22
阅读次数:
331
该类为反射函数 获取和暴力获取ReflectPoin类中的属性
package com.tuozou.test;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public class ReflectTes...
分类:
编程语言 时间:
2014-06-24 22:02:03
阅读次数:
252
login-config元素在部署描述符中仅仅出现一次,它包含了auth-method元素,指定了Authentiction方法。就这是说context仅仅有LoginConfig的一个实例对象并部署一个校验类的实现。
AuthentictorBase类的哪个子类用作context的校验值取决于部署描述符中auth-method元素的值。auth-method值有一下几种:
B...
分类:
其他好文 时间:
2014-06-24 20:26:39
阅读次数:
248
1:Class类中的方法
public Method getDeclaredMethod(String name,
Class... parameterTypes)
throws NoSuchMethodException,
...
分类:
编程语言 时间:
2014-06-24 15:37:45
阅读次数:
201
在算法分析中,当一个算法中包括递归调用时,其时间复杂度的分析会转化为一个递归方程求解。实际上,这个问题是数学上求解渐近阶的问题,而递归方程的形式多种多样,其求解方法也是不一而足,比較经常使用的有下面四种方法: (1)代入法(Substitution Method) 代入法的基本步骤是先猜測递归方程....
分类:
其他好文 时间:
2014-06-24 13:36:31
阅读次数:
195