JAVA and C ++ cross-platform

Source: Internet
Author: User

JAVA and C ++ cross-platform

Today I reviewed java and learned the Class Loader. The first class loader in jvm is BootStrap, which is used to load other class loaders, such as AppClassLoader. If you are not clear about it, you can go to the Internet and check out the video of "java high technology" by Dr. Zhang Xiaoxiang.

In the video, instructor Zhang mentioned that BootStrap was written in C ++, so he introduced the idea of whether C ++ is cross-platform, because I always know that JAVA is promoting cross-platform, I have heard of it occasionally.. net supports C # development for linux.

Baidu found that there are different opinions in one circle, but it can be determined that C ++ can be cross-platform, but the implementation method is different.

Here we reference the comments of netizens:

The C ++ programming language is cross-platform, which is exactly the goal of his design.
Re-compilation is required, but the executable code output by the C ++ compiler is not cross-platform, but this is one of the cross-platform implementation methods of the C ++ source code.
Have you ever thought that C ++ development tools can be installed on the development platform without any installation? Java must install JVM on the target platform, in your opinion, this is called cross-platform. It is not cross-platform. It only runs on its own platform. It attaches a Java Virtual Machine Platform to all platforms, similar to a small operating system.
Java itself is a platform.

-----------------------------------

Summary:

This indicates that all languages are cross-platform. After all, to attract users to use them, the expressions are different from the operation methods. Here, "one compilation, run everywhere" is introduced ". Java is not a compilation mechanism, but an interpretation mechanism.

Java only needs to be compiled once. After JVM is installed, the underlying processing is handled by it. The JVM also uses C ++ to help you achieve interaction with the underlying hardware. You only need to understand the APIS provided by java to write cross-platform programs, and you do not need to go to the operating system platform.

A metaphor from a netizen:

If Java programs are compared to "Chinese", the bytecode is equivalent to "World Language". world language does not match the specific "country". As long as this "country" provides "Translation ", then, you can quickly translate the world language to the local language.

Blog recommendation: http://blog.csdn.net/wangyongxia921/article/details/28117155

-----------------------------------

 

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.