What are the relationships and differences between C + +, JAVA, and C #? __python

Source: Internet
Author: User
Although they are not a language, they are also connected. Broadly speaking, C can be viewed as the source language of the other three languages, since almost all the other three languages come from C, and the other three languages have indications from C, whether from data types or control statements.

C + + is generally seen as an extension of the language.

Because C language has no object-oriented grammatical structure, and the industry needs object-oriented programming characteristics, so Bell Labs developers for C added an object-oriented structure. C + + is now more than just a C extension, it can be seen as a new programming language. Although C's features and library functions are still supported by C + +, C + + has its own independent class library system, which is quite powerful.

The Java language is a completely object-oriented language, although its underlying (Run-time library) is developed in C language, but does not depend on C.

Because Java is run with the support of the runtime library, therefore, the efficiency of the operating efficiency than can be closer to the bottom of C + + to have an impact, but the Java class Library with a good design concept design, very useful, but also very practical, has become a standard development language industry. Its cross-platform features are especially popular with many developers, and you only need to develop it once to run on all systems that have Java Run-time libraries installed. Java has developed for more than more than 10 years, can be widely used in the field of web development has JSP,J2EE, desktop areas are now JavaFX.

C # is a programming language developed by Microsoft, syntax similar to Java, almost from the Java version.

The

operation is similar to Java and is run through the support of the Run-time library. But the support platform is still very limited. Java is supported by almost all platforms, while C # is currently supported only by Windows and Linux, and support under Windows is certainly developed by Microsoft itself, while Linux support is mono. In fact, mono is also translating C # applications into Java applications, so in essence, C # is still only supported by Microsoft's own operating system. The limitations of the application platform are its biggest drawbacks. Java is a simplified C + +   (1) C + + The subclass has three different forms of inheritance for the parent class, and the default is private inheritance, which means that all the contents of the parent class, in addition to private, become private members of the subclass. Protection inheritance is that the exposed and protected members of subclasses are protected in subclasses, and that public inheritance is a common member of the parent class, which is still public in the subclass and protected in the subclass. This is the scenario in C + +. One of the benefits of inheritance is that code is reused, in C + +, because inheritance defaults to private inheritance, so we can't use the code of the parent class in the subclass, which limits the object-oriented attributes. This has been improved in Java. Inheritance is not controlled in Java, but uses the common inheritance effect in C + + so that we can dispense with the addition of the keyword public during inheritance and facilitate programming. Also facilitates the reuse of code.
  (2) C + + uses the concept of pure virtual functions to make abstract class declarations. In Java, there is a corresponding syntax, but the virtual key is used here because it is an abstract class, so in Java, the keyword Abstract (abstract) is used. As long as there is in the life of the class, only the method header and the concrete implementation of the method are abstract classes. In this way, if we want to live an abstract class, then we can simply not implement the implementation of this class, and not specifically declare it abstract. But in C + +, because the declaration of the class is allowed to be separated from the implementation of the Class (The life of the class is placed in a file, and the implementation of the class is placed in another file, or even in a file, but the implementation of the member function of the class is not in the declaration body of the class, so it must be clearly stated in C + + that this is a pure virtual function, Instead of simply not implementing it as in Java, it means that it is pure virtual.

  (3) There is also the point that in C + + We access the members of the object with more->, whereas in Java we use dots (.) to represent. This is because in C + + we have the concept of pointers, and in Java, this concept is removed. Because to implement a class-level polymorphism, we want to use a pointer to a parent class, so in C + +, it is often used, and in Java, a "." is used. You can do the same thing. One needs two keys, and the other one is all you need. This is a big improvement for programmers who have the idea of using the least code to solve problems. Java: Indisputably having all the essence of C + +   When comparing Java and C #, you cannot be aware of their many similarities, This is to some extent due to their common source: C and C + +. But when Gosling and his colleagues sat down to create Java, they not only learned the capabilities of C + +, but more importantly, they lost some of the unwanted features that made C + + easier to make mistakes and harder to learn. C # 's designers have added a lot of C + + features, and Java has added these features, but C # has not removed some of the worst features of C + +. The result is a language that still provides all the attributes for all, but the outcome is an internal conflict that is too complex. The security weakening of C # C # has a simple mechanism for marking areas of code as unsafe. In these insecure areas, Java and later C # have put in place security measures to prevent programmers from directly modifying memory locations and using dot
operations, but these measures are questionable. When you use a high-level language with garbage cleanup, if you go down to the memory address layer, the object/memory is deliberately separated and confused. Errors are easy to come by,
try to get nightmares, buffer overflows rise again, and the famous security vulnerabilities in C and C + + appear again.

Some forums say: > What rubbish theory. C # is how to copy java.
C # Plagiarism Java is obvious to all, Microsoft itself admits, but to change to neutral words: Inherit and absorb. This basic history will be a question of how to communicate with such programmers. The
>java is too slow. and C # is very fast, and his features are almost indistinguishable from Java. I just use C # as a fast java.

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.