<?php
#迭代器原理演示
class MyIterator implements Iterator{
#定义一个属性,原来记录执行次数
private $pos;
#定义要遍历的数组
private $arr=array(
'first_param',
'secnod_param',
'third_param'
);
#定义构造函数
public functi...
分类:
Web程序 时间:
2015-03-11 14:50:11
阅读次数:
157
上代码:
package com.itany.MyLinkedList;
import java.util.ConcurrentModificationException;
import java.util.Iterator;
import java.util.NoSuchElementException;
public class MyLinkedList implements Itera...
分类:
编程语言 时间:
2015-03-10 12:12:27
阅读次数:
181
加filter:public class RightFilter implements Filter { public void init(FilterConfig filterConfig) throws ServletException { } public void doFi...
分类:
Web程序 时间:
2015-03-10 06:46:05
阅读次数:
117
public class PropertiesUtil extends PropertyPlaceholderConfigurer implements
Map<String, String> {
private static final Logger logger = Logger.getLogger(PropertiesUtil.class);
private static M...
分类:
编程语言 时间:
2015-03-09 13:01:14
阅读次数:
174
上代码:
package com.itany.MyArrayList;
import java.util.Iterator;
public class MyArrayList implements Iterable
{
private static final int DEFAULT_CAPACITY=10;//默认数组容量大小
private int theSize;//集...
分类:
编程语言 时间:
2015-03-08 17:20:20
阅读次数:
240
场景设置
Boy 有一束鲜花要送给 Girl,但是又不好意思送,因此寻找Proxy将鲜花转交给Girl。
首先定义鲜花持有者接口,实现该接口的类都具有送花的能力:interface FlowerKeeper{
public void sendFlower();
}然后定义Boy类,能够拥有鲜花并且有送鲜花的能力(只是不亲自送而已):class Boy implements FlowerK...
分类:
其他好文 时间:
2015-03-08 13:03:47
阅读次数:
102
疑惑解答:1.interface接口不能够实例化(new),但是可以定义引用来指向继承该接口的实体类;如:interface animal{ void eat();}class Cat implements animal{ public void eat(){ System.out.pr...
分类:
其他好文 时间:
2015-03-08 00:01:47
阅读次数:
431
书本上的例子改编后的。 1 package test2; 2 3 class A{ 4 interface B{void f();} 5 public class BImp implements B{public void f(){}} 6 private class BI...
分类:
编程语言 时间:
2015-03-05 20:47:07
阅读次数:
202
getMethods()); //var_dump($reflection->getProperties()); class dbTypes implements ArrayAccess{ private $dbtypes = array(); ...
分类:
数据库 时间:
2015-03-05 18:49:13
阅读次数:
155
本人菜鸟没有用过枚举类型,举个别人的例子:实体类:public class Client implements Serializable{ private Long id; //标识符ID private String clientName; //客户姓名 private String c...
分类:
其他好文 时间:
2015-03-05 16:15:10
阅读次数:
109