public interface IHashStorage<T> { public static final float INITIAL_LOAD_FACTOR = 0.7f; public static final int INITIAL_CAPACITY = 149; }
I have the code above that needs to be translated into C #. The only solution that seems right is to make it an abstract class. From what I found safer, use readonly than const:
public abstract class IHashStorage<T> { private readonly float INITIAL_LOAD_FACTOR = (float)0.7; private readonly int INITIAL_CAPACITY = 149; }
A project in Java uses the Decorator and Proxy templates; to convert from java to C # you may need to use more abstract classes (currently only interfaces are used in java)? I know theoretically the difference between the two, but practically in C # I used abstract classes more. I am not familiar with java, and I would like to know your advice on how to find the best solution to solve this problem. I mean the main points to consider when converting code.
David source share