标签:三角形 htm nload win url main inner OLE span
下面的例子说明匿名内部类的匿名构造函数的用法 (视频下载) (全部书籍)
例2.7.2_0
interface FigureMark_to_win {
void whoAmI();
}
public class Test {
public static void main(String[] args) {
FigureMark_to_win ttm = new FigureMark_to_win() {
private String msg = "三角形";
{//马克-to-win: 匿名构造函数
msg = "长方形";
}
public void whoAmI() {
System.out.println(msg);
}
。。。。。。。。。。。。。。。。。
详情请进:http://www.mark-to-win.com/index.html?content=JavaBeginner/javaUrl.html&chapter=JavaBeginner/JavaBeginner4_web.html#AnonymousConstructor
标签:三角形 htm nload win url main inner OLE span
原文地址:https://www.cnblogs.com/mark-to-win/p/9694706.html