Chinaunix首页 | 论坛 | 博客
  • 博客访问: 346095
  • 博文数量: 168
  • 博客积分: 6895
  • 博客等级: 准将
  • 技术积分: 1726
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-12 23:01
文章分类

全部博文(168)

文章存档

2011年(6)

2010年(162)

我的朋友

分类: LINUX

2010-11-15 13:31:56

   Use System.arraycopy to solve this problem.
 
/**
 * @(#)wsi.java
 * @author, Harry Wei.
 * @version 1.00 2010-11-15
 */
public class wsi
{
    public static void main(String[] args)
    {
        String a="Hello";
        output(a);
    }
    static void output(String str){
 
 char[] b = new char[5];
 System.arraycopy( str.toCharArray(), 0, b, 0, str.length() ); 
            for( int i=0; i<5; i++)
                System.out.println(b[i]);
        }
}
阅读(635) | 评论(0) | 转发(0) |
0

上一篇:11 13

下一篇:11 15

给主人留下些什么吧!~~