楼主: ReneeBK
1115 6

OCA / OCP Practice Tests [推广有奖]

  • 1关注
  • 62粉丝

VIP

已卖:4898份资源

学术权威

14%

还不是VIP/贵宾

-

TA的文库  其他...

R资源总汇

Panel Data Analysis

Experimental Design

威望
1
论坛币
49640 个
通用积分
55.8137
学术水平
370 点
热心指数
273 点
信用等级
335 点
经验
57805 点
帖子
4005
精华
21
在线时间
582 小时
注册时间
2005-5-8
最后登录
2023-11-26

楼主
ReneeBK 发表于 2017-6-25 04:49:05 |AI写论文
1论坛币

关键词:Practice practic Tests test ACT

沙发
ReneeBK 发表于 2017-6-25 04:50:37

11.01

  1. Which answer choice can replace line 6 so the code continues to produce the same
  2. output?
  3. 3: List<String> rug = new ArrayList<>();
  4. 4: rug.add("circle");
  5. 5: rug.add("square");
  6. 6: System.out.println(rug);
  7. A. System.out.println(rug.asString);
  8. B. System.out.println(rug.asString());
  9. C. System.out.println(rug.toString);
  10. D. System.out.println(rug.toString());
复制代码

藤椅
ReneeBK 发表于 2017-6-25 04:52:44

11.02

  1. Which best describes this code?
  2. class Stats {
  3. private int data;
  4. public int getData() {
  5. return data;
  6. }
  7. public void setData(int data) {
  8. this.data = data;
  9. }
  10. }
  11. A. It is a singleton.
  12. B. It is well encapsulated.
  13. C. It is immutable.
  14. D. It is both well encapsulated and immutable.
复制代码

板凳
ReneeBK 发表于 2017-6-25 04:54:03

11.03

  1. What design pattern or principle ensures that there will be no more than one instance
  2. of a class?
  3. A. Encapsulation
  4. B. Immutability
  5. C. Singleton
  6. D. Static
复制代码

报纸
ReneeBK 发表于 2017-6-25 04:56:22

11.07

  1. Which is the first line to fail to compile?
  2. class Tool {
  3. void use() { } // r1
  4. }
  5. class Hammer extends Tool {
  6. private void use() { } // r2
  7. public void bang() { } // r3
  8. }
  9. A. r1
  10. B. r2
  11. C. r3
  12. D. None of the above
复制代码

地板
ReneeBK 发表于 2017-6-25 04:57:41

11.08

  1. Which of these classes properly implement(s) the singleton pattern?
  2. class ExamAnswers {
  3. private static ExamAnswers instance = new ExamAnswers();
  4. private List<String> answers = new ArrayList<>();
  5. public static List<String> getAnswers() {
  6. return instance.answers;
  7. }
  8. }
  9. class TestAnswers {
  10. private static TestAnswers instance = new TestAnswers();
  11. private List<String> answers = new ArrayList<>();
  12. public static TestAnswers getTestAnswers() {
  13. return instance;
  14. }
  15. public List<String> getAnswers() {
  16. return answers;
  17. }
  18. }
  19. A. ExamAnswers
  20. B. TestAnswers
  21. C. Both classes
  22. D. Neither class
复制代码

7
ReneeBK 发表于 2017-6-25 04:59:37

11.09

  1. What does the following print?
  2. public class Transport {
  3. static interface Vehicle {}
  4. static class Bus implements Vehicle {}
  5. public static void main(String[] args) {
  6. Bus bus = new Bus();
  7. boolean n = null instanceof Bus;
  8. boolean v = bus instanceof Vehicle;
  9. boolean b = bus instanceof Bus;
  10. System.out.println(n + " " + v + " " + b);
  11. }
  12. }
  13. A. true true true
  14. B. false true true
  15. C. false false false
  16. D. None of the above
复制代码

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-6 13:57