Java Conceptual issues accumulate

Source: Internet
Author: User

1. What are the three core features of object-oriented technology?

Answer: abstract (encapsulation), polymorphic, inheritance.

2. What is the principle of encapsulation?

A: Packaging principle: 1 Hidden Object properties and implementation details, only public excuses, and control access level;
In object-oriented methods, classes are used to implement the above requirements. The encapsulation is implemented by class, and the encapsulation is used to realize high cohesion and low coupling.

3. Is the method overload?

A: Method overloading refers to defining multiple methods with the same name in a class, but requiring the number of types or parameters for each method to have different parameters. (Parameters are also characteristics of the method)

4. How does the method differ from the load cover?

1, the method's coverage is the relationship between the subclass and the parent class, is the vertical relationship, the overloading of the method is the relationship between the methods in the same class, and is the horizontal relationship.
2. Overrides can only be made by one method, or only by a pair of methods; an overload of a method is a relationship between multiple methods.
3. The override requires the same parameter list, and the overload requires the parameter list to be different.
4, in the coverage relationship, call that method body, is based on the object type (object corresponding to the storage space type) to determine, overload relationship, is based on the invocation of the argument table and formal parameter list to select the method body.

it to

Java Conceptual issues accumulate

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.