公眾號:mywangxiao
及時(shí)發(fā)布考試資訊
分享考試技巧、復(fù)習(xí)經(jīng)驗(yàn)
新浪微博 @wangxiaocn關(guān)注微博
聯(lián)系方式 400-18-8000
Question: 4
Given the following definition:
String s = story;
Which of the following expressions are legal?
A. s += books;
B. char c = s[1];
C. int len = s.length;
D. String t = s.toLowerCase();
Explanation:
Answer B is not correct for String is a class and can'T be treated as an array of char. Answer C is not correct for s.length() should be used, not s.length.
Correct Answer: A,D 4 of 60
Question: 5
What is the return value of the main() method in Java?
A. String
B. int
C. char
D. void
Explanation:
The main() method in Java returns void.
Correct Answer: D 5 of 60
編輯推薦:
JAVA認(rèn)證考試報(bào)考指南 / 更多JAVA考試模擬試題
(責(zé)任編輯:)