Similar Books


    No books found

Title
Chapter: 12 / Q: 8
(HexFormatException) Exercise 12.6 implements the hex2Dec method to throw a NumberFormatException if the string is not a hex string. Define a custom exception called HexFormatException. Implement the hex2Dec method to throw a HexFormatException if the string is not a hex string
Chapter: 12 / Q: 9
(BinaryFormatException) Exercise 12.7 implements the bin2Dec method to throw a BinaryFormatException if the string is not a binary string. Define a custom exception called BinaryFormatException. Implement the bin2Dec method to throw a BinaryFormatException if the string is not a binary string
Chapter: 12 / Q: 10
(OutOfMemoryError) Write a program that causes the JVM to throw an OutOfMemoryError and catches and handles this error
Chapter: 12 / Q: 11
(Remove text) Write a program that removes all the occurrences of a specified string from a text file. For example, invoking
Chapter: 12 / Q: 12
(Reformat Java source code) Write a program that converts the Java source code from the next-line brace style to the end-of-line brace style. For example, the following Java source in (a) uses the next-line brace style. Your program converts it to the end-of-line brace style in (b)
Chapter: 12 / Q: 13
(Count characters, words, and lines in a file) Write a program that will count the number of characters, words, and lines in a file. Words are separated by whitespace characters. The file name should be passed as a command-line argument, as shown in Figure 12.13
Chapter: 12 / Q: 14
(Process scores in a text file) Suppose that a text file contains an unspecified number of scores separated by blanks. Write a program that prompts the user to enter the file, reads the scores from the file, and displays their total and average
Chapter: 12 / Q: 15
(Write/read data) Write a program to create a file named Exercise12_15.txt if it does not exist. Write 100 integers created randomly into the file using text I/O. Integers are separated by spaces in the file. Read the data back from the file and display the data in increasing order
Chapter: 12 / Q: 16
(Replace text) Listing 12.16, ReplaceText.java, gives a program that replaces text in a source file and saves the change into a new file. Revise the program to save the change into the original file. For example, invoking
Chapter: 12 / Q: 17
(Game: hangman) Rewrite Programming Exercise 7.35. The program reads the words stored in a text file named hangman.txt. Words are delimited by spaces
total questions: 772

Questions

772

Views

A PHP Error was encountered

Severity: Warning

Message: Undefined property: stdClass::$TotalViews

Filename: books/book.php

Line Number: 411

Best Answers

299

Points

5