| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 701 人关注过本帖
标题:大佬帮忙,谢谢!
只看楼主 加入收藏
huangzhi326959
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2008-9-19
收藏
 问题点数:0 回复次数:1 
大佬帮忙,谢谢!
我的程序是:
import *;
public class j205
{
      public static void main(String args[])
      {
            person5 chy = new person5(100,"chy");
            chy.SetHead("咖啡黑","不是方形","黑色",57.7);
            chy.theH.showHeadProperties();
      }
}
interface HeadInter
{
      public void showHeadProperties();
}
class person5
{
      public HeadInter theH;
      private int age;
      public String name;
      public person5(int a,String n)
      {
            age = a; name = n ;
      }
      public void SetHead(final String e,final String f,final String h,final Double s)
      {
           theH = new HeadInter()
           {
                String eye;
                String face;
                String hair;
                Double size;
                {
                     eye =e; face = f; hair = h;size = s;
                     if(age > 80)
                        hair = hair  + ",有白发";
                }   
                public void showHeadProperties()
                {
                  System.out.println(name + " 的头: " + " \n眼睛: " + eye + " \n脸: " + face + " \n头发: " + hair + " \n头围: " + size);
                }
            };
      }
}



它老报个错误  j205.java:7: SetHead(java.land.string,java.land.string,java.land.string,java.land.double )
in person5 cannot be applied to (java.land.string,java.land.string,java.land.string,java.land.double )
chy.SetHead("咖啡黑","不是方形","黑色",57.7);
   ^
搜索更多相关主题的帖子: 大佬 
2008-09-19 20:23
meteor57
Rank: 1
来 自:银河系
等 级:新手上路
帖 子:267
专家分:0
注 册:2007-9-29
收藏
得分:0 
貌似没什么问题啊...
2008-09-21 17:04
快速回复:大佬帮忙,谢谢!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.019774 second(s), 10 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved