C # with java control

xiaoxiao2021-03-06  42

C # Basic Type Conversion: System.convert () is significantly different: Java's default access level for classes and class members is: Package C # Default Everything is private private. C # Internal corresponding to Java package

C # interface member countless, all methods are defrauded to public, but can not bring public

Members of the derived class cover the basis of the base class: use New

C # class related modifiers: class default public attribute, method, nature, etc.

C # Yes NEW is used for Override for Override Override for Abstract or Virtual method

About OVERRIDE: Override is the method that can access after the parent class or subclass is instantiated. If it is a private method, Override has no meaning, so in C #, the private method even if it is repeated not Override, but Java may be counted.

C # and Java about Override's rules are different: (if two methods are signed) C #: But if both methods are exactly the same and are private, they are meaningless, not Override (at this time, I have added NEW. ), At least one of the instances can be accessed. Java: If the signature of the two methods, the access modifier of the subclass must be greater than the access modifier of the parent class, otherwise it will not form Override normally, it will be reported, but C # will not appear.

Class C # class constructor call constructor struct point {public int x, y; public point (int x, int y); public Point: Point (pt.x, pt.y) {} // can , C # allow};

This grammar is very metapped! Just use this in Java.

转载请注明原文地址:https://www.9cbs.com/read-52540.html

New Post(0)