After the transformation, began to enter the learning time, the following is the collation of learning notes C # and Java some differences between
1, = = and equals
In C #, the comparison of strings can be = = to compare, but in java use = = has always been false, originally in Java = = is used to see whether two references to the same memory address, equals is the value of the comparison object is equal, the total known string is the reference type of the
2, switch the difference
In C #, after the case has output statements, must match break, can support long and string type key judgment, but in Java case after the case does not break the next case block, do not throw an exception error. String (Java7 only), does not support long type judgment
3. Substring method
C # is substring (start position, intercept length) in Java is substring (start position, end position)
4, inheritance, interface implementation
C # Direct use: Java to use extends, implements
5. Default access for classes
is accessed in the same assembly in C # and can only be accessed in the same package in Java
6. Object type operator
Use instanceof in C # with IS, as Java
7, operator overloading (can only be implemented in C #)
There are other commands to introduce external objects, exception processing thrown, C # in the unique properties of simplification, indexing, iterators and so on, expect everyone to teach, find more differences, together deepen the understanding of knowledge.
Java Fundamentals for the Java programmer family