public final class Test4{ class Inner{
void test(){
if (Test4.this.flag);{
sample();
}
}
}
private boolean flag=false;
public void sample(){
System.out.println("Sample");
} public Test4(){
(new Inner()).test();
} public static void main(String args[]){
new Test4();
}
}
What is the result: A.Print out “Sample” B.Program produces no output but termiantes correctly. C. Program does not terminate. D.The program will not compile
void test(){
if (Test4.this.flag);{
sample();
}
}
}
private boolean flag=false;
public void sample(){
System.out.println("Sample");
} public Test4(){
(new Inner()).test();
} public static void main(String args[]){
new Test4();
}
}
What is the result: A.Print out “Sample” B.Program produces no output but termiantes correctly. C. Program does not terminate. D.The program will not compile
解决方案 »
- 关于JAVA中使用log4J,不用配置文件,卡主了
- RAS 加密解密问题继续大侠帮助。
- ajax异步调用出现问题。
- 中文乱码问题
- 上传图片报错
- 你觉得使用Struts有必要考虑缓存的问题吗?
- 怎样用session bean 来处理cmp bean,以实现对数据的操作,(最好有例子)分不够再加!
- jspsmartupload在jdk1.4下好像无法取得值为中文的参数,各位碰到这个问题吗?
- Converter编译的一个简单问题?快烦死了!
- 2000可用分求一份管理方面的J2EE架构的例子。。
- java项目在windows下中文正常但是在AIX下中文乱码
- BEA-101017 错误 javax.servlet.jsp.JspException: Input/output 如何解决?
这个if是不会起作用的.!
所以输出Sample
void test() {
if (Test4.this.flag)
;
{
sample();
}
}
} private boolean flag = false; public void sample() {
System.out.println("Sample");
} public Test4() {
(new Inner()).test();
} public static void main(String args[]) {
new Test4();
}
}排版成这样 你看懂了么