D.13. Wrap-Up

In this appendix, you learned more about method declarations. You also learned the difference between non-static and static methods and how to call static methods by preceding the method name with the name of the class in which it appears and the dot (.)separator. You learned how to use operators + and += to perform string concatenations. We discussed how the method-call stack and activation records keep track of the methods that have been called and where each method must return to when it completes its task. We also discussed Java’s promotion rules for converting implicitly between primitive types and how to perform explicit conversions with cast operators. Next, you learned about some of the commonly used packages in the Java API.

You saw how to declare named constants using both enum types and public static final variables. You used class Random to generate random numbers for simulations. You also learned about the scope of fields and local variables in a class. Finally, you learned that multiple methods in one class can be overloaded by providing methods with the same name and different signatures. Such methods can be used to perform the same or similar tasks using different types or different numbers of parameters.

In Appendix E, you’ll learn how to maintain lists and tables of data in arrays. You’ll see a more elegant implementation of the application that rolls a die 6,000,000 times and two enhanced versions of our GradeBook case study that you studied in Appendices B–C. You’ll also learn how to access an application’s command-line arguments that are passed to method main when an application begins execution.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset