Glossary of Java name reuse

Source: Internet
Author: User

1 coverage

An instance method can overwrite all instance methods with the same signature that can be accessed in its superclass, enabling the use of dynamic allocation mechanisms. In other words, the VM chooses the replication method to invoke based on the type of the run time. Overwrite is the basis of object-oriented programming technology.

class base{   publicvoid  f () {}   }classextends  base{    Public void f ();}
View Code

2 Hidden

A field, a static method, or a member type can hide all fields, static methods, or member types that have the same name (the same method signature for a method) that can be accessed in its superclass, hiding a member that prevents it from being inherited.

class base{    publicstaticvoid  f () {}   }classextends  base{   publicstaticvoid f () {}// hidden Base.F ()     }
View Code

3 overloading

Methods in a class can overload another method, as long as they have the same name and different signatures. The overloaded method specified by the call is selected at compile time.

class circuitbreaker{publicvoid f (int i) {}//int overloading  publicvoid F (string s) {}//  string overloading}
View Code

Glossary of Java name reuse

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.