Page 185 - Introduction to Programming with Java: A Problem Solving Approach
P. 185

                 0.0 Last A-Head 151
CHAPTER 5
    Using Pre-Built Methods
Objectives
• See what it takes to incorporate Java’s pre-built API software into your programs, and become acquainted with Sun’s documentation of the API software.
• Use the methods and named constants defined in Java’s Math class.
• Use the parsing methods in wrapper classes to convert text representations of numbers into numerical
format, and learn to use the toString methods to go the other way.
• Use methods in the Character class to identify and alter character types and formats.
• Use methods in the String class to find the first index of a particular character, extract or replace
substrings, convert case, and trim leading and trailing whitespaces.
window and run a Java applet.
Outline
5.1 Introduction
5.2 TheAPILibrary
5.3 MathClass
5.4 WrapperClassesforPrimitiveTypes
5.5 CharacterClass
5.6 StringMethods
5.7 FormattedOutputwiththeprintfMethod
5.8 ProblemSolvingwithRandomNumbers(Optional)
5.9 GUITrack:DrawingImages,Lines,Rectangles,andOvalsinJavaApplets(Optional)
 Apago PDF Enhancer
• Format output with the System.out.printf method.
• Optionally use the Random class to generate non-uniform random-number distributions.
• Optionally see how to draw geometric shapes, display pictures, and display text on a graphics display
 151








































































   183   184   185   186   187