内部类代码写法

/// <summary>
 /// 测试内部类代码.暂时保留
 /// </summary>
 public class Goods
 {
  private class Content : Contents
  {
      private int i = 11;
   public int value1()
   {
    return i;
   }
  }
  protected class GDestination:Destination
  {
   private String label;
   private GDestination(string whereTo)
  {
   label = whereTo;
  }
  public string readLabel()
  {
   return label;
  }
   public Destination dest(String s)
   {
    return new GDestination(s);
   }
   public Contents cont()
   {
    return new Content();
   }
 }


 }
 public interface Contents
 {
  int value1();
 }

 public interface Destination
 {
  string readLabel();
 }

posted @ 2005-12-15 15:30  meetweb  阅读(538)  评论(0编辑  收藏  举报