Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Chapter 9 - Characters and strings. After you have read and studied this chapter, you should be able to: Declare and manipulate data of the char data type; write string processing program, applicable in areas such as bioinformatics, using String, StringBuilder, and StringBuffer objects; differentiate the three string classes and use the correct class for a given task; specify regular expressions for searching a pattern in a string; use the Pattern and Matcher classes; compare the String objects correctly. | Chapter 9 Characters and Strings 4th Ed Chapter 9 - ©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Objectives After you have read and studied this chapter, you should be able to Declare and manipulate data of the char data type. Write string processing program using String, StringBuilder, and StringBuffer objects. Differentiate the three string classes and use the correct class for a given task. Specify regular expressions for searching a pattern in a string. Use the Pattern and Matcher classes. Compare the String objects correctly. 4th Ed Chapter 9 - ©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. We will cover the basic string processing in this lesson, manipulating char and String data. Characters In Java, single characters are represented using the data type char. Character constants are written as symbols enclosed in single quotes. Characters are stored in a computer memory using some form of encoding. ASCII, which stands for American Standard Code for Information Interchange, is one of the document coding schemes widely used today. Java uses Unicode, which includes ASCII, for representing char constants. 4th Ed Chapter 9 - ©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. ASCII Encoding For example, character 'O' is 79 (row value 70 + col value 9 = 79). O 9 70 4th Ed Chapter 9 - ©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Characters can be stored in a computer memory using the ASCII encoding. The ASCII codes range from 0 to 127. The character 'A' is represented as 65, for example. The ASCII values from 0 to 32 are called nonprintable control characters. For example, ASCII code 04 eot stands for End of Transmission. We can use this character to signal the end of transmission of data when sending data over a communication line. Unicode Encoding The Unicode Worldwide Character Standard (Unicode) supports the . | Chapter 9 Characters and Strings 4th Ed Chapter 9 - ©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Objectives After you have read and studied this chapter, you should be able to Declare and manipulate data of the char data type. Write string processing program using String, StringBuilder, and StringBuffer objects. Differentiate the three string classes and use the correct class for a given task. Specify regular expressions for searching a pattern in a string. Use the Pattern and Matcher classes. Compare the String objects correctly. 4th Ed Chapter 9 - ©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. We will cover the basic string processing in this lesson, manipulating char and String data. Characters In Java, single characters are represented using the data type char. Character constants are written as symbols enclosed in single quotes. Characters are stored in a computer memory using some form of encoding. .