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 (www.oxfordscholarship.com). (c) Copyright Oxford University Press, 2019. All Rights Reserved. An individual user may print out a PDF of a single chapter of a monograph in OSO for personal use. date: 17 October 2019

Encapsulation and the C++ class

Encapsulation and the C++ class

Chapter:
(p.30) 2 Encapsulation and the C++ class
Source:
Applied Computational Physics
Author(s):

Joseph F. Boudreau

Eric S. Swanson

Publisher:
Oxford University Press
DOI:10.1093/oso/9780198708636.003.0002

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 .