现在的位置: 首页 > 综合 > 正文

.new的应用

2013年10月13日 ⁄ 综合 ⁄ 共 398字 ⁄ 字号 评论关闭

public class Parcel3
{
 class Contents
 {
  private int  i = 11;
  public int value()
  {
   return i;
  }

 }
 class Destination
 {
  private String label;
  Destination(String whereTo)
  {
   label = whereTo;
  }
  String readLabel()
  {
   return label;
  }
 }
 public static void main(String args[])
 {
  Parcel3 p = new Parcel3();
  Parcel3.Contents c = p.new Contents();
  Parcel3.Destination d = p.new Destination("阮明辉");
  d.readLabel();
  c.value();
 }
}

抱歉!评论已关闭.