Jump to ContentJump to Main Navigation
Applied Computational Physics$
Users without a subscription are not able to see the full content.

Joseph F. Boudreau and Eric. S. Swanson

Print publication date: 2017

Print ISBN-13: 9780198708636

Published to Oxford Scholarship Online: February 2018

DOI: 10.1093/oso/9780198708636.001.0001

Show Summary Details
Page of

PRINTED FROM OXFORD SCHOLARSHIP ONLINE (oxford.universitypressscholarship.com). (c) Copyright Oxford University Press, 2020. All Rights Reserved. An individual user may print out a PDF of a single chapter of a monograph in OSO for personal use. date: 24 November 2020

Encapsulation and the C++ class

Encapsulation and the C++ class

(p.30) 2 Encapsulation and the C++ class
Applied Computational Physics

Joseph F. Boudreau

Eric S. Swanson

Oxford University Press

Built-in datatypes and C++ classes are introduced in this chapter, and discussed in relation to the important notion of encapsulation, which refers to the separation between the internal representation of the datatype and the operations to which it responds. Encapsulation later becomes an important consideration in the design of custom C++ classes that programmers develop themselves. It is illustrated with built-in floating-point datatypes float and double and with the complex class from the C++ standard library. While a sophisticated programmer is aware of the internal representation of data and its resulting limitations, encapsulation allows one to consider these as details and frees one to think at a higher level of program design. Some simple numerical examples are discussed in the text and in the exercises.

Keywords:   encapsulation, datatype, class, float, double, complex, built-in

Oxford Scholarship Online requires a subscription or purchase to access the full text of books within the service. Public users can however freely search the site and view the abstracts and keywords for each book and chapter.

Please, subscribe or login to access full text content.

If you think you should have access to this title, please contact your librarian.

To troubleshoot, please check our FAQs , and if you can't find the answer there, please contact us .