tailieunhanh - Introduction to java programming: Chapter 8 - Strings and Text I/O

Introduction to java programming: Chapter 8 - Strings and Text I/O's Objectives is to use the String class to process fixed strings; use the Character class to process a single character; use the StringBuilder/StringBuffer class to process flexible strings. | Chapter 8 Strings and Text I O Liang Introduction to Java Programming Sixth Edition c 2005 Pearson Education Inc. All rights reserved. 0-13-148952-6 1 Objectives To use the String class to process fixed strings . To use the Character class to process a single character . To use the StringBuilder StringBuffer class to process flexible strings . To know the differences between the String StringBuilder and StringBuffer classes . To learn how to pass strings to the main method from the command line . Optional To use the regular expressions to represent patterns for matching replacing and splitting strings . To discover file properties delete and rename files using the File class . To write data to a file using the PrintWriter class . To read data from a file using the Scanner class . Liang Introduction to Java Programming Sixth Edition c 2005 Pearson Education Inc. All 2 rights reserved. 0-13-148952-6 2 The String Class Constructing a String - String message Welcome to Java - String message new String Welcome to Java - String s new String Obtaining String length and Retrieving Individual Characters in a string String Concatenation concat Substrings substring index substring start end Comparisons equals compareTo String Conversions Finding a Character or a Substring in a String Conversions between Strings and Arrays Converting Characters and Numeric Values to Strings Liang Introduction to Java Programming Sixth Edition c 2005 Pearson Education Inc. All 3 rights reserved. .