java编程笔记5 主要是StringBuffer和StringTokenizer
2011-03-15 12:56
651 查看
2011-03-02 20:08
一, 字符串数组 构造函数: String[] array = new String[5]; String[] array =new String[] {“aa”,”bb”,”cc”}; String[] array = {“aa”,”bb”,”cc”}; 字符串数组也被看做对象: 属性:length (区别于字符串的方法length()) 常用方法:void System.arraycopy(object[] from,intfromIndex, object[] to,int fromIndex,int count),系统的一个静态方法 二,字符串缓存类StringBuffer String类对象一旦声明就不能改变,StringBuffer缓存类实现了可变字符序列。 StringBuffer上的基本操作是append和insert方法,它们接受任意的数据,把所给数据转化为一个字符串,并把这个字符串添加到缓冲区的末端或者插到指定地方。 public final class StringBuffer extends Object implements Serializable, CharSequence
StringBuffer转化为String对象:toString()
任意类型都将被转化为字符串加入缓存末端 StringBuffer的插入insert():
典型的其他操作:
|
相关文章推荐
- java编程笔记5 接上主要是StringBuffer和StringTokenizer
- Java笔记(5)-String、StringBuffer、StringTokenizer、Date、Calendar
- Java学习笔记11——数据库编程
- Java并发编程笔记1-竞争条件&初识原子类&可重入锁
- Java编程思想重点笔记(Java开发必看)
- Java并发编程实践阅读笔记
- java编程思想笔记07-复用类
- Java学习笔记之网络编程基础-根据域名自动到DNS上获取IP地址
- java编程笔记20 XML开发简介
- JAVA编程思想笔记--泛型
- 终于有人说出来了——Java不适合于作为主要编程教学语言
- java编程思想学习笔记(二)
- Java之网络编程笔记
- Android 网络编程 API笔记 - java.net 包 权限 地址 套接字 相关类 简介
- java笔记 StringBuffer容器笔记
- 编程实践笔记{Java 线程 并发处理 Webservice}
- 编程学习笔记之Java相关:包的概念和使用
- Java编程思想---第一章笔记
- Java 编程思想(第四版)学习笔记(7)复用类
- Java编程思想_笔记(三)