Java Programming Lesson II

Source: Internet
Author: User
Abstract base classes and interfaces can use Keywordabstact to create abstract classes that cannot be instantiated and can use Keywordabstact to describe a method that has not yet been implemented in detail, which cannot include a method body an abstract method can only be created in an abstract class. When the class is inherited, the abstract method must be implemented in detail, or the inheriting class is declared as a drawing class
Interfacekeyword is further than the Abstact class, and does not agree that there are methods to define interfaces that provide a perfect separation between interfaces and implementations, Java does not support multiple inheritance, but can achieve this by implementing multiple interfaces.
C + + places objects on the stack or static storage Java provides a mechanism called the garbage collector, which can proactively discover when an object is not used and then destroy it
In Java, all classes finally inherit from the single Ultimate base class object advantage: A single inheritance structure ensures that all objects have some functionality one-root inheritance structure makes the garbage collector's implementation much easier
Exception handling it is thrown from the wrong place and is appropriately designed to handle exception handler captures for specific types of exceptions
C + +: manipulating objects with pointers Java: Referencing an object refers to a remote control, which is equivalent to a TV

Java Programming Lesson II

Related Article

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.