Java ?е?????????????
???????????? ???????[ 2013/12/17 10:45:20 ] ????????
????????????????? Content ?? GDestination ???????????? Goods ??????????????? protected ?? private ???η?????????????Content ?????? Goods ????????? GDestination ?????? Goods ????????????????????????? Content ?? Destination???????? main ??????????? Contents c ?? Destination d ???в????????????????????????????????п???????????????????????????????????????????????????????????????????
????????????????????????????÷?Χ??????????????????????????????????????????????????????????е? cont() ?? dest() ???????????????????????б????????????У???????????£?
????outerObject=new outerClass(Constructor Parameters);
????outerClass.innerClass innerObject=outerObject.new InnerClass(Constructor Parameters);
???????????????????????????????????????????????????????????????????????????????
????* ?????????????????????????????????
?????????????????????
public class Goods {
private valueRate=2;
private class Content implements Contents {
private int i = 11 * valueRate;
public int value() {
return i;
}
}
protected class GDestination implements 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();
}
}
|
????????????????????????????????? Goods ??????????? private ??????? valueRate?????????????????????????? Content ????? value() ????????????????????????value() ??????? valueRate?????????????????????????????????????????????????????????????????????б?????????????????????????????????????????????·???????????????????????????????????????????????á?Java ????????????????????????????????????????????????????????????????????????????????????????????????????????????????÷?Χ???????????????????????????????????????
?????????????????????????????????????????????????????????????????????????????????????????£?Java???????????????????????
????outerClass.this
??????????????????????????ε???????
????* ????????
?????????????????????????????о?????????????????????????????????????????????????????á????????? C++ ?е??????????????Java ??????? C++ ????????????????????????????????????????????????????????Щ???????????????
??????????????κη?????????У????????о????????????????????????????????????????????????????????????????????????????С?????????????????????ɡ?
????* ????????
????????Java ???????????????????????????????????????????????????
public class Goods1 {
public Destination dest(String s) {
class GDestination implements Destination {
private String label;
private GDestination(String whereTo) {
label = whereTo;
}
public String readLabel() { return label; }
}
return new GDestination(s);
}
public static void main(String[] args) {
Goods1 g= new Goods1();
Destination d = g.dest("Beijing");
}
}
|
???????????????????????????dest???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????е??????????????????????????????????????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
Java???????????Щ???????????????Java????????????????Java?б???Map????????Java Web???????????????Java??????????????д?????Java????????7???????????????????????(java .net ?????)???Java??????????Python??????Java webdriver??λ????????′????е?????Java??д??????????????????Java???????????????JavaScript????????????Java?????????????????? Java???????10??????????????Java?м????????????????java???????ü???????????м???????????????????

???·???
App??С????H5?????????????????Щ??
2024/9/11 15:34:34?????????????????????????
2024/9/10 11:13:49P-One ???????????????????????????????????????
2024/9/10 10:14:12???????????????????????????
2024/9/9 18:04:26??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44