08-Encapsulation

08-Encapsulation - Chapter VIII Encapsulation and Creating...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Chapter VIII Encapsulation and Creating Object Methods Chapter VIII Topics 8.1 Introduction 8.2 Creating New Objects 8.3 Constructors 8.4 Using Private and Public 8.5 The CardDeck Case Study 8.6 The Bank Class Revisited 8.7 The Cube Case Study 8.8 Method Summary 8.9 Do You Understand Methods and Parameters? Chapter VIII Encapsulation and Creating Object Methods 379 8.1 Introduction Object Oriented Programming will not be casually mentioned in this chapter. OOP is the front-center topic right now and the intention is to cover some very important OOP ground. Right now you have a variety of basic Java tools under your belt and you are ready to learn about this very fascinating modern approach to programming. Now keep in mind that the single most important goal for any program is reliability . Speed is great, user-friendly is requested, cheap is desirable, but nothing matters if the software does not work properly. First and foremost a program, or program module, must perform its intended task correctly, the first time, the last time and every time in between. There used to be a time in the early days of programming that the simplicity of the programs and the genius of the computer scientists kept reliability pretty much afloat with hard work and an organized approach to programming. In particular, programming became popular by dividing a program into manageable blocks, and concentrate on completing and testing the smaller blocks. Names like structured programming , modular programming , procedural programming , became important buzzwords and programming tools. Keep in mind that early programs only produced text output. You should know text output, because many program examples have produced text output so far. With the arrival of Graphical User Interface ( GUI ) the world of programming changed very dramatically, and program complexity has been growing exponentially every since. A new style of programming came on the scene slowly, at first, but rapidly gained momentum and brought about a whole new way of thinking about programming. Now it matters little if impressive vocabulary is tossed around. The bottom line is still reliability , and as you gain more computer science knowledge you will see how Object Oriented Programming in general and Java in particular do an outstanding job to make programs more reliable. In an earlier chapter you were told that the three corner stones of OOP are encapsulation , polymorphism , and inheritance . Some brief introduction to encapsulation happened earlier during the previous two chapters. This chapter will continue to explore encapsulation and pick up the pace dramatically. Programs involve data and the modules that access and process the data. The problem in the past has been that the data and the modules processing the data, called procedures and functions , were separated. This approach caused serious reliability problems. As programs grew in size so did the likelihood that some procedure or function accessed data unintentionally and made unwanted and 380 Exposure Java 2009, APCS Edition 08-08-09 often disastrous changes to data values. often disastrous changes to data values....
View Full Document

This note was uploaded on 10/14/2010 for the course APSC AP taught by Professor Kurt during the Spring '98 term at Wooster.

Page1 / 70

08-Encapsulation - Chapter VIII Encapsulation and Creating...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online