Java------Frequently asked questions of the face

Source: Internet
Author: User
What is the difference between Java and C language?

1.C language is a process-oriented language, execution efficiency is high; Java is an object-oriented language with less execution efficiency than C language.

2. Pointers, Java No pointers, and pointer-type C language The greatest advantage, he can give users access to almost all of the computer's memory resources and other parts of the resources.

3. Automatic memory management, Java has garbage collection mechanism, all the objects in the Java program are built on the memory stack with the new operation, theJava automatic does not need the memory reclamation operation, does not require the programmer to delete. in C language, memory resources must be freed by program Shell.

4. Data types and classes. Java is a fully object-oriented language, and all functions and variables must be part of the class. In addition to the basic data types (Boolean, char, Byte, short, int, long, float, double, and so on, the rest is the class object, including the array.

5. Multiple inheritance: C + + supports multiple inheritance, a feature of C + + that allows a class to be derived from a multi-parent class. Although multiple inheritance is powerful, it is complex to use and can cause a lot of trouble, and it is not easy for the compiler to implement it. Java does not support multiple inheritance, but allows a class to inherit multiple interfaces (interfaces), realize the function of C + + multiple inheritance, and avoid many defects of C + +.

Java------Frequently asked questions of the face

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.