In this chapter, we will delve more deeply into the String class and present advanced string processing. We will also introduce the char data type for representing a single character and the StringBuffer class for an efficient operation on a certain type of string processing. | Chapter 9 Characters and Strings Chapter 9 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 programs, using String and StringBuffer objects. Differentiate the String and StringBuffer classes and use the correct class in solving a given task. Tell the difference between equality and equivalence testings for String objects. ©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Characters In Java, single characters are represented using the data type char. Character constants are written as symbols enclosed in single quotes: char ch1 = ‘X’; ©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Characters ASCII stands for American Standard Code for Information Interchange. ASCII is one of the document coding schemes widely used today. This coding scheme allows different computers to share information easily. ©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Characters ASCII works well for English-language documents because all characters and punctuation marks are included in the ASCII codes. ASCII does not represent the full character sets of other languages. ©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Characters The Unicode Worldwide Character Standard (Unicode) supports the interchange, processing, and display of the written texts of diverse languages. Java uses the Unicode standard for representing char constants. ©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Strings A string is a sequence of characters that is treated as a single value. Instances of the String class are used to represent strings in Java. We access individual characters of a string by calling the charAt method of the String object. ©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Strings | Chapter 9 Characters and Strings Chapter 9 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 programs, using String and StringBuffer objects. Differentiate the String and StringBuffer classes and use the correct class in solving a given task. Tell the difference between equality and equivalence testings for String objects. ©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Characters In Java, single characters are represented using the data type char. Character constants are written as symbols enclosed in single quotes: char ch1 = ‘X’; ©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Characters ASCII stands for American Standard Code for Information Interchange. ASCII is one of the document coding schemes widely used today. This coding scheme allows different computers to share information easily. ©TheMcGraw-Hill