Java Programming Lesson II

Source: Internet
Author: User
Abstract base classes and interfaces can use the keyword Abstact to create abstract classes that cannot be instantiated or use keyword Abstact to describe a method that has not yet been specifically implemented, which cannot contain a method body an abstract method can only be created in an abstract class, and when the class is inherited, the An abstract method must have a specific implementation, or an inherited class is declared as a drawing class
The interface keyword is a step further than the Abstact class, and does not allow for a method-defined interface to provide a perfect separation between interfaces and implementations, and 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 automatically discovers when an object is not used and then destroys it
In Java, all classes ultimately 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.