QUESTION NO 117
Given:
1. public class Foo {
2. public void main (String [] args) {
3. system.out.printIn(“Hello World.”);
4. }
5. }
What is the result?
A. An exception is thrown.
B. The code does no compile.
C. “Hello World.” Is printed to the terminal.
D. The program exits without printing anything.
网上搜集的scjp题,往往出题内容中就有错误,所以有时不知道出的题在考那方面?就这道题,如果出对的话,那么就应该选B,为什么答案选A,难道又是出题错误.
应该是 public static void main(String[] args)编译时没问题的
运行时抛Exception
所以选A
问的是
What is the result?如果那段代码不运行,也就不会抛异常,编译也是能通过,
还有,不运行代码的时候,更别提打印输出什莫了,d显然也是不对所以,偶觉得应该明确是代码被编译后的结果
还是运行的结果