简体   繁体   English

.Net实现标准java类

[英].Net implementation of standard java classes

Does anyone know of a .Net assembly that contains classes with the same functionality of the typical java types: 有没有人知道.Net程序集包含具有与典型java类型相同功能的类:

For instance, .Net implementations (preferably c#) of the following that contain the same methods that the java classes contain. 例如,以下的.Net实现(最好是c#)包含与java类相同的方法。

java.util.HashMap 的java.util.HashMap

java.util.LinkedList java.util.LinkedList中

etc... 等等...

I know of some fundamental differences between java collections and .net collections, such as the ability to remove elements during enumeration, but that does not mean that most functions cannot be implemented in .net. 我知道java集合和.net集合之间的一些基本差异,例如在枚举期间删除元素的能力,但这并不意味着大多数函数都不能在.net中实现。

Thanks in advance. 提前致谢。

如果您正在寻找与Java兼容的API接口,您可能需要查看IKVM

System.Collections.GenericSystem.Collections保存您要查找的类型, LinkedListHashTable尽管可能有更好的替代方法,例如Dictionary<TKey, TValue>具体取决于您的意图。

Take a look at the System.Collections or System.Collections.Generic namespaces in .NET, these contain the main collection classes. 查看.NET中的System.CollectionsSystem.Collections.Generic命名空间,它们包含主要的集合类。

Another useful tool you might want to check out is IKVM.NET . 您可能想要查看的另一个有用的工具是IKVM.NET This framework allows you to use the Java API classes from .NET, and provides some mechanisms for interoperate between Java and .NET. 此框架允许您使用.NET中的Java API类,并提供一些Java和.NET之间的互操作机制。

Are you looking for exactly the same methods? 你在寻找完全相同的方法吗?

I mean, HashMap is basically the same as Dictionary<TKey, TValue> , while LinkedList is basically the same as LinkedList<T> . 我的意思是, HashMap基本相同Dictionary<TKey, TValue> ,而LinkedList基本相同LinkedList<T> So there's that. 就是这样。

I don't know that anyone's made exact clones just because it's unclear what the value of that would be. 我不知道是否有人制造了完全克隆因为它不清楚它的价值是什么。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM