开发者

.Net implementation of standard java classes

开发者 https://www.devze.com 2023-02-17 03:49 出处:网络
Does anyone know of a .Net assembly that contains classes with the same functionality of the typical java types:

Does anyone know of a .Net assembly that contains classes with the same functionality of the typical java types:

For instance, .Net implementations (preferably c#) of the following that contain the same methods that the java classes contain.

java.util.HashMap

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.

Thanks in 开发者_运维技巧advance.


If you are looking for API compatible interfaces with Java, you may want to look into IKVM.


System.Collections.Generic and System.Collections hold the types you are looking for, LinkedList and HashTable respecitively although there are probably better alternatives with generics such as a Dictionary<TKey, TValue> depending on your intentions.


Take a look at the System.Collections or System.Collections.Generic namespaces in .NET, these contain the main collection classes.

Another useful tool you might want to check out is IKVM.NET. This framework allows you to use the Java API classes from .NET, and provides some mechanisms for interoperate between Java and .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>. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消