Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2110923
  • 博文数量: 413
  • 博客积分: 10926
  • 博客等级: 上将
  • 技术积分: 3862
  • 用 户 组: 普通用户
  • 注册时间: 2006-01-09 18:14
文章分类

全部博文(413)

文章存档

2015年(5)

2014年(1)

2013年(5)

2012年(6)

2011年(138)

2010年(85)

2009年(42)

2008年(46)

2007年(26)

2006年(59)

分类: Java

2010-09-13 13:36:37

  1. String
    The String class represents an immutable (unchangeable) sequence of Unicode (16-bit encoding) characters, appropriate for storing characters in any language (English, German, Japanese, and so on).

    If you modify the contents of a String, a new String object is returned, such as to invoke replace(), toLowerCase().

    Other Topics
    • String Literals
      (from: )
      • Literal strings within the same class in the same package represent references to the same String object.
      • Literal strings within different classes in the same package represent references to the same String object.
      • Literal strings within different classes in different packages likewise represent references to the same String object.
      • Strings computed by constant expressions are computed at compile time and then treated as if they were literals.
      • Strings computed by concatenation at run time are newly created and therefore distinct.
      • xxx
    • String and bytes
      When to create an instance of String from bytes, or get bytes from String, you can specify the coding type, or use the default one. General coding types include:
      • US-ASCII
      • ISO-8859-1
      • UTF-8
      • UTF-16BE
      • UTF-16LE
      • UTF-16
    • Compare
      Invoke String.equal to check if contents of two String objects are equal; Don't use 'str1 == str2', since it only check if str1 and str2 refer to the same String object.
    • xxx
  2. StringBuffer
    It is mutable. This class is more effective than String if you need to change its contents frequently, since all changes only take  place in inner buffer, and delay to create String object when it is necesssary.

    And tis class is synchronized, that means the methods have synchronized modifier.
  3. StringBuilder
    It it mutable as well. It is not synchronized, that means the methods have no synchronized modifier.
  4. Formatter
    Formats arguments according to a format string. The format strings and specifiers are also defined in this class, such as %s, %d, %#x, etc.
  5. Regular Expression
    • StringTokenizer
      Allow an application to break a string into tokens by performing code point comparison.
    • Scanner
      A parser that parses a text string of primitive types and strings with the help of regular expressions. The input is broken into tokens by the delimiter pattern, which is whitespace by default.
  6. xxx
阅读(1008) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~