在编程武林中,Java派成立较久底细雄厚,尽管掌门人Sun已经老气横秋,乡山之技的Java语言已经被后进的后起之秀.NET派的C#压得喘不过气来,甚至有时Sun头儿还得跑到.NET派打掩护学艺。但是百足之虫,死而不僵,一众Java派的拥趸们自认诚然Java逐渐技不如人,但是Java派成立日久,从Java演变过来的七十二门绝招远非武林暴发户.NET派所能比拟,内中几大支使如apache,springsource各有绝招,而派生出的帮会、匪帮之类更其不可胜数,.NET派不可企及。
然则江湖传说有不世神功叫北冥神功,“北冥有鱼,其名叫鲲,鲲之大,不知其几千里也……”,能够容纳几千里的大鱼必定是是非非常辽阔的大洋,因此北冥神功恰是寓含了宽广伸张之意,也反映了神功的威力。“可以吸取旁人的内功以供己用,是迅速擢升功底的近路。内功既厚,天下武功无不为我所用,宛如北冥,大舟小舟无不载,大鱼小鱼无不容。”
.NET派的几位圣人闭关苦练,居然体悟北冥神功,此神功后曰:IKVM.NET.
江湖后辈小子Ray Linn偶习此神功,得经验一二,不敢自珍,特此记之,以扩大我.NET门派,万古千秋,一统江湖。
那日Ray偶赶来apache支系,却看到Apache学徒们各施绝招,好不热烈. Ray对Apache绝招手痒已久,想来得习IKVM.NET已有时候日,斗胆上前叫阵。应战者哪Apache派中的小学徒,江湖人称:commons.collection.
二人拳脚来去,Ray却懒得与之多动手脚,过后默念真言:
Java代码
一.ikvmc -assembly:commons -target:library -version:1.0.0.0 commons-collections-3.2.1.jar
ikvmc -assembly:commons -target:library -version:1.0.0.0 commons-collections-3.2.1.jar
collection蓦然萎缩在地,念是通身内力尽被Ray所吸去,Apache派人等尽皆失色,“我等苦练10短载,内功尽为汝一夕取去”,莫敢上前。
Ray扭转.NET派,试练collection的神功,凭借IKVM.OpenJDK.Core之神器,神功即成,预演如次:
C#代码
一.using System;
2.
三.using org.apache.commons.collections;
四.using org.apache.commons.collections.functors;
5.
六.namespace MyLib
7.{
8. class Program
9. {
10. static void Main(string[] args)
11. {
12. String name = "Tim";
13. Predicate nameJohn = new EqualPredicate( "John" );
14. Predicate nameTim = new EqualPredicate( "Tim" );
15. Predicate instanceString = new InstanceofPredicate(typeof(String) );
16. Predicate instanceDouble = new InstanceofPredicate(typeof(Double));
17. Console.Out.WriteLine( "Is Name John?: " + nameJohn.evaluate( name ) );
18. Console.Out.WriteLine("Is Name Tim?: " + nameTim.evaluate(name));
19. Console.Out.WriteLine( "Is this a String?: " + instanceString.evaluate( name ) );
20. Console.Out.WriteLine( "Is this a Double?: " + instanceDouble.evaluate( name ) );
21.
22. }
23. }
24.}
using System;
using org.apache.commons.collections;
using org.apache.commons.collections.functors;
namespace MyLib
{
class Program
{
static void Main(string[] args)
{
String name = "Tim";
Predicate nameJohn = new EqualPredicate( "John" );
Predicate nameTim = new EqualPredicate( "Tim" );
Predicate instanceString = new InstanceofPredicate(typeof(String) );
Predicate instanceDouble = new InstanceofPredicate(typeof(Double));
Console.Out.WriteLine( "Is Name John?: " + nameJohn.evaluate( name ) );
Console.Out.WriteLine("Is Name Tim?: " + nameTim.evaluate(name));
Console.Out.WriteLine( "Is this a String?: " + instanceString.evaluate( name ) );
Console.Out.WriteLine( "Is this a Double?: " + instanceDouble.evaluate( name ) );
}
}
}
相较原有神功:
Java代码
一.import org.apache.commons.collection.Predicate;
二.import org.apache.commons.collection.functors.*;
三.String name = "Tim";
四.Predicate nameJohn = new EqualPredicate( "John" );
五.Predicate nameTim = new EqualPredicate( "Tim" );
六.Predicate instanceString = new InstanceofPredicate( String.class );
七.Predicate instanceDouble = new InstanceofPredicate( Double.class );
8.// Testing all predicates for "Tim"
九.System.out.println( "Is Name John?: " + nameJohn.evaluate( name ) );
十.System.out.println( "Is Name Tim?: " + nameTim.evaluate( name ) );
11.System.out.println( "Is this a String?: " + instanceString.evaluate( name ) );
12.System.out.println( "Is this a Double?: " + instanceDouble.evaluate( name ) );
import org.apache.commons.collection.Predicate;
import org.apache.commons.collection.functors.*;
String name = "Tim";
Predicate nameJohn = new EqualPredicate( "John" );
Predicate nameTim = new EqualPredicate( "Tim" );
Predicate instanceString = new InstanceofPredicate( String.class );
Predicate instanceDouble = new InstanceofPredicate( Double.class );
// Testing all predicates for "Tim"
System.out.println( "Is Name John?: " + nameJohn.evaluate( name ) );
System.out.println( "Is Name Tim?: " + nameTim.evaluate( name ) );
System.out.println( "Is this a String?: " + instanceString.evaluate( name ) );
System.out.println( "Is this a Double?: " + instanceDouble.evaluate( name ) );
居然绝无2致。
偌大Java江湖,自此为我.NET所用,哇哈哈哈
本文来源:
我的异常网
Java Exception
Dotnet Exception
Oracle Exception
- 1715 - org.apache.jasper.JasperException: For input string
- 1717 - 0x636293b6指令引用的0x89e87589内存.改内存不能读
- 1718 - machine debug manager
- 1719 - 内部错误 2755 无法读取设备或文件 netfx.msi
- 1720 - unknow error
- 1721 - 无法将A.dll复制到运行目录
- 1722 - 无法找到脚本库
- 1723 - System.Runtime.Remoting.Channels.Tcp.TcpChannel
- 1724 - CLR error:80007000b.The program will now terminate
- 1725 - HTTP1.1 500 Internal Server Error
- 1726 - 通过表关联将某表若干字段的数据赋值到另外一表的对应字段
- 1727 - ORA-12545 因目标主机或对象不存在
- 1728 - 连接失败
- 1729 - 使用exp备份文件用当前日期做为文件名
- 1730 - ORA-12535: TNS:operation timed out
- 1731 - 错误1606:未能找到网络位置2052
- 1732 - oracle增量导入更新
- 1733 - 错误1719
- 1734 - The Windows Installer Service could not be accessed