1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > char 数组java_Java 将char数组复制到另一个char数组

char 数组java_Java 将char数组复制到另一个char数组

时间:2022-11-17 07:12:41

相关推荐

char 数组java_Java 将char数组复制到另一个char数组

/*来自

N o w J a v a . c o m - 时 代 Java*/

public class ArrayCopyDemo {

public static void main(String[] args) {

char[] copyFrom = { d, e, c, a, f, f, e, i, ,

a, , e, d };

char[] copyTo = new char[7];

System.arraycopy(copyFrom, 2, copyTo, 0, 7);

System.out.println(new String(copyTo));

}

}

/*

* Copyright (c) 1995, , Oracle and/or its affiliates. All rights reserved.

*

* Redistribution and use in source and binary forms, with or without

* modification, are permitted provided that the following conditions

* are met:

*

* - Redistributions of source code must retain the above copyright

* notice, this list of conditions and the followi

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。