Java Puzzlers笔记--puzzle 22:Dupe of URL url的使用
2007-03-07 21:57
525 查看
public class BrowserTest{
public static void main(String[] args){
System.out.println("iexplore.exe");
http://www.google.com
System.out.println(":maxmize");
}
}
Solution:
显示:iexplore.exe
:maxmize
由于URL在java中被认为是注释,不做任何事情
TID:
The URL that appears in the middle of the program is a statement lable followed by an end-of-line comment.
The lesson of this puzzle is that misleading comments and extraneous code cause confusion. Write comments carefully and keep them up to date. Excise dead code.
public static void main(String[] args){
System.out.println("iexplore.exe");
http://www.google.com
System.out.println(":maxmize");
}
}
Solution:
显示:iexplore.exe
:maxmize
由于URL在java中被认为是注释,不做任何事情
TID:
The URL that appears in the middle of the program is a statement lable followed by an end-of-line comment.
The lesson of this puzzle is that misleading comments and extraneous code cause confusion. Write comments carefully and keep them up to date. Excise dead code.
相关文章推荐
- Java Puzzlers笔记--puzzle 5: The joy of Hex 十六进制计算问题
- Java Puzzlers笔记--puzzle 20: What's my Class? String.replaceAll()的使用
- Java Puzzlers笔记--Puzzle 2: Time for a change 关于浮点型的问题
- Java Puzzlers笔记--puzzle 14: Escape Rout (")双引号的问题
- Java Puzzlers笔记--puzzle 6: Multicast 类型转换
- Java Puzzlers笔记--puzzle 7: Swap Meat ^符号问题
- Java Puzzlers笔记--puzzle 15: Hello Whirled -Unicode字符问题
- Java Puzzlers笔记--puzzle 17: Huh? 转义字符问题
- Java Puzzlers笔记--puzzle 19: Classy Fire 注释问题
- Java Puzzlers笔记--puzzle 8: Dos Equis 选择操作符问题
- Java Puzzlers笔记--Puzzle 3: Long Division 溢出问题
- Java Puzzlers笔记--puzzle 9: Tweedledum +=的问题
- (JAVA SE 学习笔记)Java.SE.第003讲.原生数据类型使用陷阱.Pitfall.of.Primitive.Data.Type
- Java Puzzlers笔记--Puzzle 1: Oddity奇偶问题
- Java Puzzlers笔记--puzzle 10: Tweedledee += 问题(2)
- Java Puzzlers笔记--puzzle 11: The last laugh "" 与''的区别
- Java Puzzlers笔记--puzzle 12: ABC String与char的区别
- java安全框架-Shiro学习笔记(六)-url匹配方式+shiro标签使用+session会话机制
- Java Puzzlers笔记--puzzle 13: Animal Farm 优先级以及对象引用问题
- Java Puzzlers笔记--puzzle 21: What's my Class, take 2 路径字符问题