Java Reference
In-Depth Information
a. str.regionMatches(6, str1, 0, str1.length())
b. str.regionMatches( true , 31, "Analysis", 0, 8)
12. Which class contains the function pow ? Write the statement to use the
method pow to compute and output 6.5 3.5 .
13. Suppose that name is a variable of type String . Write the input statement
to read and store the input Brenda Clinton in name . (Assume that the
input is from the standard input device and it is the only input in a line; and
console is a Scanner object initialized to the standard input device.)
14. a. What method is used to create an input dialog box?
b. What method is used to create an output dialog box?
c. What is the name of the class that contains the methods to create
input and output dialog boxes?
d. What is the name of the package that contains the class described in
part c?
15. What does the following statement do? (Assume that scoreStr is a String
variable.)
scoreStr = JOptionPane.showInputDialog("Enter the score:");
16. Write a Java statement that creates the output dialog box in Figure 3-16.
3
FIGURE 3-16 Figure for Exercise 16, Chapter 3
17. Write a Java statement that creates the output dialog box in Figure 3-17.
FIGURE 3-17 Figure for Exercise 17, Chapter 3
Search WWH ::




Custom Search