Differences between JAVA and. net

Source: Internet
Author: User

Differences between JAVA and. net

Currently. most of NET's understanding can be summarized as: At first, it was a clone product of the Java platform (note that it is a platform and should not be confused with the Java language). Later, it gradually evolved and had its own features. Because the most significant feature of the Java platform is "platform independence" (or do not know who invented the Write once, Run anywhere Statement ). Theoretically, you can write a program and run it on any operating system with JVM installed after compilation. Most people think that the emergence of. NET is to follow Sun's great concept-platform independence, so as to compete with Java. Some people do not know where to come to the conclusion that, even if there are non-Windows platforms like Mono. net clr.. NET programs cannot be transplanted to other operating systems. For example, Winform can hardly be transplanted to Linux through Mono. Therefore, it came to the shocking conclusion that Microsoft did not completely imitate the imitation, but it was a pseudo cross-platform.

The above is the conclusion I have seen most recently:. NET's fatal weakness is that it is not really cross-platform. For this reason, I have the following instructions:

(1) The emergence of the. NET platform does not support cross-platform development. It only aims to optimize the traditional Windows development mode, making Windows development more convenient and convenient. It solves the Dll Hell problem (. net assembly version control), integrated with a variety of languages (to facilitate a variety of programmers), components written in each language (assembly) can communicate without barriers, A collection of ob ject-Oriented and Component-Oriented, you can use a Component (dll) to generate a new type without all the source code of the type (this is not possible in the UnManaged era), and truly implement binary compatibility (you change a Public Member in the Assembly, if the client program using this assembly does not use this public member, the client does not need to be re-compiled at all), provides memory management not available in C ++, supports exception handling, and so on. Strictly speaking, Microsoft released. the first day of NET is for its Windows, so it has no intention of letting programs you write run on other operating systems (Microsoft has not released an official non-Windows platform so far.. net clr ).

(2) Let's Talk About the Java platform and. the goal pursued by the two companies, the former from the very beginning: In the Internet world, I want a language to run in any operating system, while the latter thinks: in the Internet world, I want to run all languages in the same operating system (Windows ). The two platforms are designed differently from the very beginning.

(3) The two emphasize different points:

For example, the red part is extended by others.

(4) as described in section 3 above, the two platforms have a similar structure. I don't know whether Microsoft has plagiarized Java, but I can be sure that if the two are the original intention, both platforms support "cross-platform" and "multi-language support. As for why Mono cannot be used.. NET program to Linux, this is easy to explain, Microsoft was not planning.. NET program is transplanted to other platforms ,. NET is closely related to Windows. It is difficult to translate these frameworks into code that can be executed on non-Windows platforms. In addition, Java is not completely cross-platform. It depends on the framework actually used in development. When the above situations cannot be transplanted, there are two key points: one is the framework you used during development, the other is CLR (or JVM ), it depends on whether the latter can translate the former into executable code of the corresponding platform.

In summary, the two platforms have different focuses. Do you think it is better to compare apples and bananas?

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.