2013年12月6日

摘要: 1, Lambda表达式(input parameters) => expression例如(x,y) => x==y2, Lambda语句(input parameters) => {statement;}例如n=>{String s = n + "World";}; 阅读全文

posted @ 2013-12-06 20:41 chayu3 阅读(197) 评论(0) 推荐(0)

2013年12月5日

摘要: =====================Quote starts==================JAX-WS (JavaTM API for XML-Based Web Services)规范是一组XML web services的JAVA API。JAX-WS允许开发者可以选择RPC-oriented或者message-oriented 来实现自己的web services。【以下内容来自http://blog.csdn.net/kkdelta/article/details/4017747】写道1、客户端开发者通过URL得到WSDL文件。(通过HTTP访问可以得到,http://?w 阅读全文

posted @ 2013-12-05 22:26 chayu3 阅读(220) 评论(0) 推荐(0)

摘要: 在C# language下写单元测试要用NUnit framework,N stands for .NET,包含测试方法的类要加上[TestFixture] annotation.建立线程用Thread类,instantiate一个thread要用new Thread(new ThreadStart(Work.DoWork)); 运行一个线程要用.start()方法。Nullable types have the following characteristics:Nullable types represent value-type variables that can be assigne 阅读全文

posted @ 2013-12-05 00:11 chayu3 阅读(199) 评论(0) 推荐(0)

2013年12月4日

摘要: 实现Serializable的class表明object可以被保存。被保存的时候实际是存储class里的instance variable,这样在deserialization的时候可以恢复object。但是这些instance variable的class也需要是implement Serializable的,这样它才可以被保存;如果无法序列化,可以填加Transient关键字。重要的code部分:FileOutputStream file = new FileOutputStream("pond.ser"); ObjectOutputStream os = new Ob 阅读全文

posted @ 2013-12-04 20:58 chayu3 阅读(231) 评论(0) 推荐(0)

2013年11月25日

摘要: public delegate void MyDelegate(string mydelegate);//声明一个delegate对象//实现有相同参数和返回值的函数 public void HelloDelegate(string mydelegate) { Console.WriteLine(mydelegate); }MyDelegate mydelegate = new MyDelegate(testClass.HelloDelegate);//产生delegate对象mydelegate("Hello delegate");//调用From MSDN: [C# d 阅读全文

posted @ 2013-11-25 19:58 chayu3 阅读(239) 评论(0) 推荐(0)

2013年11月15日

该文被密码保护。 阅读全文

posted @ 2013-11-15 00:32 chayu3 阅读(0) 评论(0) 推荐(0)

2013年11月4日

摘要: Pay attention:When using these annotations, the object itself has to be created by Spring context. If the object is instantiated in code, then this object is out-of-scope of Spring!Spring不但支持自己定义的@Autowired注解,还支持几个由JSR-250规范定义的注解,它们分别是@Resource、@PostConstruct以及@PreDestroy。 @Resource的作用相当于@Autowired. 阅读全文

posted @ 2013-11-04 20:34 chayu3 阅读(207) 评论(0) 推荐(0)

2013年10月30日

摘要: Here's the Animal class:public class Animal{private Map friends =new HashMap();public void addFriend(String name,Animal animal){ friends.put(name,animal);}public Animal callFriend(String name){return friends.get(name);}}And here's some code snippet with lots of typecasting:Mouse jerry =newMo 阅读全文

posted @ 2013-10-30 17:14 chayu3 阅读(150) 评论(0) 推荐(0)

2013年8月27日

摘要: Enum is a reference type(similar to a class, interface and array), which holds a reference to memory in the heap. Enum class can include other compone... 阅读全文

posted @ 2013-08-27 18:49 chayu3 阅读(239) 评论(0) 推荐(0)

2013年8月21日

摘要: Client---->Interface A -- --代理类 Class AImpl代理类是动态生成的,借助Proxy类和InvocationHandler接口进行实现,InvocationHandler的invoke函数就是调用目标类实现的功能接口的地方,可以在这里进行访问控制,添加额外的... 阅读全文

posted @ 2013-08-21 14:31 chayu3 阅读(390) 评论(0) 推荐(0)