6.7-3将数组arr中索引值为2的元素替换为“bb”

package shuzu;

import java.util.Arrays;

public class TH {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		String arr[] = {"qq","ww","ee"};
		for(String x : arr)
		{
			System.out.println("替换前数组arr中元素有:"+x);
		}
		Arrays.fill(arr,2,3,"bb");
		for(String x : arr)
		{
			System.out.println("替换前数组arr中元素有:"+x);
		}
	}

}

  

posted @ 2015-10-10 08:52  dirgo  阅读(514)  评论(0编辑  收藏  举报