06-UsingObjectMethods

06-UsingObjectMethods - Chapter VI Using Object Methods...

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 VI Using Object Methods Chapter VI Topics 6.1 Introduction 6.2 Classes and Objects 6.3 Using Object Methods 6.4 Using the Random Class 6.5 Using the Math.random Method 6.6 Using the DecimalFormat Class 6.7 Working with Graphics Objects 6.8 Combining Random and Graphics Objects 6.9 Using the Scanner Class 6.10 Using the Integer Class 6.11 Worked Out Exercises 6.12 Summary Chapter VI Using Object Methods Page 241 6.1 Introduction Chapter IV started a gentle introduction to Object Oriented Programming . You learned a healthy quantity of new vocabulary used by OOP. After this brief OOP introduction, the chapter concentrated on using class methods . It really was fuzzy why you were using class methods rather than some other type of methods. This chapter aims to make the fog less dense. In particular, you will learn the difference between classes and objects as well as class methods and object methods. Part of the problem is that the word object has two meanings. There is the meaning of object in the general sense as the word object in object oriented programming . There is also a more technical meaning which helps to distinguish between a class and an object , and furthermore between a class method and an object method . Right now your understanding about this object business should be that an object is some type of structure, or container that holds information like integers, characters, strings or more complex information. We can call this information data. An object stores more than data, because data by itself lacks all functionality. We want to alter data, display data, sort data, search data or many other data processes. All these actions on the object data are performed by other object members, modules that have the ability to process data. The corner stone of objects is this business of packing both the data and various modules that process the data in the same container. Now in the Chapter IV you used a variety of methods that processed data. You saw methods capable of computing the square root, absolute value, and other mathematical computations. All these methods were called class methods. Somehow this implies that a class can also hold action modules, just like an object. It probably all sounds very confusing. I was quite confused at the first introduction to OOP and all the new vocabulary words took some time before I found myself on comfortable ground with all the different aspects of OOP. This chapter will start by clarifying the difference between a class and an object and then continue to show you how to use object methods. Page 242 Exposure Java 2009, APCS Edition 08-08-09 6.2 Classes and Objects The word class implies a collection of some category. In high school there may be a French class, a Geometry class, an Art class and a Computer Science class....
View Full Document

Page1 / 64

06-UsingObjectMethods - Chapter VI Using Object Methods...

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