import javax.swing.*;
public class Etest
{
public static void main(String[] args)
{
char char1[]=new char[50];
String f1= new String("1234abcd");
f1.getChars(0,6,char1,0);
for (int s=0;s<char1.length ; s++)
{System.out.print(char1[s]);}
}
}
public class Etest
{
public static void main(String[] args)
{
char char1[]=new char[50];
String f1= new String("1234abcd");
f1.getChars(0,6,char1,0);
for (int s=0;s<char1.length ; s++)
{System.out.print(char1[s]);}
}
}
public class Etest
{
public static void main(String[] args)
{
char char1[]=new char[50];
String f1= new String("1234abcd"); //new
f1.getChars(0,6,char1,0);
for (int s=0;s<char1.length ; s++) //char1.length ,因为char是数组,而f1是字符串与数组不同,不能说其元素数目的length实例变量,要用方法
{System.out.print(char1[s]);}
}
}