MagicLen · https://magiclen.org
筆者自高中二年級之後就開始在學承電腦上 Java 課程,因為自己本身有在使用 Linux,所以非常了解 Java 語言跨平台的好處,自從接觸 Java 程式語言之後就愛上了它,之後還陸續買了許多本 Java 的書籍。後來拿到了 TQC+ 的 Java 程式設計專業人員認證,覺得應該要再來拿拿 Oracle 的原廠認證,好跟國際接軌,便報考了 Java 8 的 Oracle Certified As...
Which two options, when inserted independently inside class Base, ensure that the class is being properly encapsulated and allow the program to execute and print the square of the number?
What is the result?
A. One
B. Two
C. Three
D. Compilation fails.
What is the result?
A. simaple A
B. Capital A
C. simaple A default Capital A
D. simaple A default
E. Compilation fails.
Which three lines, when inserted independently at line n1, cause the program to print a 0 balance?
A. this.amount = 0;
B. amount = 0;
C. acct(0);
D. acct.amount = 0;
E. acct.getAmount() = 0;
F. acct....
Which code fragment, when inserted at line //insert code here, enables the code to print COJ?
What is the result?
A.
2 4
B.
0 2 4 6
C.
0 2 4
D. Compilation fails
What is the result?
A. null
B. Compilation fails
C. An exception is thrown at runtime
D. 0
What is the result?
A.
Caught java.lang.RuntimeException: Exception
Exception in thread "main" java.lang.Error: Error
at TestApp.doList(TestApp.java: 14)
at TestApp.main(TestApp.java: 6)
B.
E...
Which of the following will print current time?
A. System.out.print(new LocalTime().now());
B. System.out.print(new LocalTime());
C. System.out.print(LocalTime.now());
D. System.out.print(LocalTime.t...