In C++ you first declare the method headers defining the types of the parameters, but giving no details on how the method is computed. Then you later define the method procedure bodies. The idea is external code only looks at the declarations. External code does not need to be recompiled unless the definitions change. Everything in the declarations is repeated in the definitions and must be manually kept in sync.
Java has a more streamlined system. An ordinary Java method acts as both a declaration to inform callers of the parameters needed and a definition to elaborate how to compute the method. In addition, Java has abstract methods and their close cousins, interface methods, which act as pure declarations. When these template methods are implemented or overridden, they act like definitions.
This page is posted |
http://mindprod.com/jgloss/declarationvsdefinition.html | |
Optional Replicator mirror
|
J:\mindprod\jgloss\declarationvsdefinition.html | |
Please read the feedback from other visitors,
or send your own feedback about the site. Contact Roedy. Please feel free to link to this page without explicit permission. | ||
Canadian
Mind
Products
IP:[65.110.21.43] Your face IP:[3.143.214.133] |
| |
Feedback |
You are visitor number | |