点击运行
public class Main { public static void main(String args[]) { String Str1 = new String("Welcome to jiyik.com"); char[] Str2 = new char[7]; try { Str1.getChars(2, 9, Str2, 0); System.out.print("Copied Value = " ); System.out.println(Str2 ); } catch ( Exception ex) { System.out.println("Raised exception..."); } } }
运行结果 :
正在执行...