Does C# have an equivalent of Java static nested class? -
I am converting Java into C # and the following is the code (see About Its Use). One approach might be to create a separate file / square, but is there any C # IDM that preserves the intention of Java code?
public square fu {// fu fields and functions // private static class SGroup {Private stationary map & lt; Integer, s group & gt; IdMap = new hashmap & lt; Integer, S group & gt; (); Public SGroup (int id, string type) {// ...}}}
Take a look at this
I'm especially looking at
In other words, Java Inner Class is syntactic Chinese, which is not available for C #. In C #, you have to do it manually.
If you want, you can make your own sugar:
class OuterClass {... innerclass newInnerClass () {return new innerclass (this); } Some Functions (Zero) () {Innerclass i = this.NewInnerClass (); I.GetOuterString (); }}
You want to write in the new O.इन class (...) in Java, then you can either New in C # Inner class (...) or new innerclass (O, ...). Yes, this is just a bunch of walking around the new word. Like I said, it's just sugar.
Comments
Post a Comment