Chapter 4 Outline
Chapter 4 Outline
What defines an object s behavior 4. Defining classes, instantiation, instance data a. Instantiation is the process of making a new object b. Data at the top of the program, or the global data 5. Do you need a main method in a class a. No 6. Class methods a. Calling b. Writing 7. Encapsulation a. Variable scope i. Within a method or class ii. Global, private, public data & methods 1. Things that should just stay in the class are private, things that can be changed can be public 8. Methods a. Returning parameters from a method i. You do not always need a return statement 1. Void 2. Constructor b. How to overload i. Signatures ii. More parameters or different type of parameters c. Decomposition d. Do you need anything in the body of a method? i. No e. Formal and actual parameters f. What is 9. Review these classes a. String b. Coin c. Die 10. Short answer a. Writing constructors, methods b. Writing headers i. int ex(double X)