java吧 关注:1,256,599贴子:12,750,036
  • 19回复贴,共1

求大神 小程序一枚 提示需要标识符 什么意思啊 哪里的错误

只看楼主收藏回复

class id
{
static String str = "name";
static char ch;
ch=str.charAt(0);
public static void main(String[] args)
{
System.out.println(ch);
}
}


IP属地:青海1楼2013-07-24 11:22回复


    IP属地:青海2楼2013-07-24 11:23
    回复
      你牛逼,,,
      ch=str.charAt(0);
      不能写在那儿,,,
      static{
      ch=str.charAt(0);

      以后有问题找我啊,,,很闲,哈哈


      IP属地:安徽3楼2013-07-24 11:28
      收起回复
        public class id{
        static String str = "name";
        static char ch;
        static{
        ch=str.charAt(0);
        }
        public static void main(String[] args)
        {
        System.out.println(ch); }
        }


        IP属地:安徽4楼2013-07-24 11:42
        收起回复


          IP属地:广东5楼2013-07-24 11:59
          回复
            i该大写!


            IP属地:北京来自Android客户端6楼2013-07-24 14:13
            回复
              虽然不影响


              IP属地:北京来自Android客户端7楼2013-07-24 14:14
              回复