Java Fundamentals for the Java programmer family

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.