tailieunhanh - Lecture Object Oriented Programing - Chapter 6: Methods: A deeper look
In this chapter you will learn: How static methods and fields are associated with an entire class rather than specific instances of the class, to use common Math methods available in the Java API, to understand the mechanisms for passing information between methods, how the method call/return mechanism is supported by the method call stack and activation records. | 6 Methods: A Deeper Look The greatest invention of the nineteenth century was the invention of the method of invention. Alfred North Whitehead Call me Ishmael. Herman Melville When you call me that, smile! Owen Wister Answer me in one word. William Shakespeare O! call back yesterday, bid time return. William Shakespeare There is a point at which methods devour themselves. Frantz Fanon OBJECTIVES In this chapter you will learn: How static methods and fields are associated with an entire class rather than specific instances of the class. To use common Math methods available in the Java API. To understand the mechanisms for passing information between methods. How the method call/return mechanism is supported by the method call stack and activation records. How packages group related classes. How to use random-number generation to implement game-playing applications. How the visibility of declarations is limited to specific regions of programs. What method overloading is and | 6 Methods: A Deeper Look The greatest invention of the nineteenth century was the invention of the method of invention. Alfred North Whitehead Call me Ishmael. Herman Melville When you call me that, smile! Owen Wister Answer me in one word. William Shakespeare O! call back yesterday, bid time return. William Shakespeare There is a point at which methods devour themselves. Frantz Fanon OBJECTIVES In this chapter you will learn: How static methods and fields are associated with an entire class rather than specific instances of the class. To use common Math methods available in the Java API. To understand the mechanisms for passing information between methods. How the method call/return mechanism is supported by the method call stack and activation records. How packages group related classes. How to use random-number generation to implement game-playing applications. How the visibility of declarations is limited to specific regions of programs. What method overloading is and how to create overloaded methods. Introduction Program Modules in Java static Methods, static Fields and Class Math Declaring Methods with Multiple Parameters Notes on Declaring and Using Methods Method Call Stack and Activation Records Argument Promotion and Casting Java API Packages Case Study: Random-Number Generation Generalized Scaling and Shifting of Random Numbers Random-Number Repeatability for Testing and Debugging Case Study: A Game of Chance (Introducing Enumerations) Scope of Declarations Method Overloading (Optional) GUI and Graphics Case Study: Colors and Filled Shapes (Optional) Software Engineering Case Study: Identifying Class Operations Wrap-Up Introduction Divide and conquer technique Construct a large program from smaller pieces (or modules) Can be accomplished using methods static methods can be called without the need for an object of the
đang nạp các trang xem trước