在主类中可以用,但在类A中用不了,提示Syntax error on tokens
哪里有句法错误哦????
class A
{
 String s=new String("gjfdhgkdf");
 char c[]=new char[4];
 s.getChars(0, 3, c, 0);       //这个地方提示出错。Syntax error on tokens
 char d[]=s.toCharArray();
 byte b[]=s.getBytes();
}
public class sss {
public static void main(String args[])
{
 String s=new String("gjfdhgkdf");
 char c[]=new char[4];
 s.getChars(0, 3, c, 0);
 char d[]=s.toCharArray();
 byte b[]=s.getBytes();
}
}

解决方案 »

  1.   

    此回复为自动发出,仅用于显示而已,并无任何其他特殊作用
    楼主【xx21546544】截止到2008-07-20 02:04:31的历史汇总数据(不包括此帖):
    发帖的总数量:1                        发帖的总分数:0                        每贴平均分数:0                        
    回帖的总数量:2                        得分贴总数量:0                        回帖的得分率:0%                       
    结贴的总数量:0                        结贴的总分数:0                        
    无满意结贴数:0                        无满意结贴分:0                        
    未结的帖子数:1                        未结的总分数:0                        
    结贴的百分比:0.00  %               结分的百分比:---------------------
    无满意结贴率:---------------------无满意结分率:---------------------
    如何结贴请参考这里:http://topic.csdn.net/u/20080501/09/ef7ba1b3-6466-49f6-9d92-36fe6d471dd1.html