Question 11 Q: 11 Given: What is the result? Options A: 3 4 5 6 B: 3 4 3 6 C: 5 4 5 6 D: 3 6 4 6 Save Question Show Answer Discussion 0 Clear Discussion Most voted Newest No comments yet. Be the first to comment. Post Be respectful. No spam. Correct Answer: C
Question 12 Q: 12 Given: What is the result? Options A: 200.0 : 100.0 B: 400.0 : 200.0 C: 400.0 : 100.0 D: Compilation fails. Save Question Show Answer Discussion 0 Clear Discussion Most voted Newest No comments yet. Be the first to comment. Post Be respectful. No spam. Correct Answer: C
Question 13 Q: 13 Which statement best describes encapsulation? Options A: Encapsulation ensures that classes can be designed so that only certain fields and methods of an object are accessible from other objects. B: Encapsulation ensures that classes can be designed so that their methods are inheritable. C: Encapsulation ensures that classes can be designed with some fields and methods declared as abstract. D: Encapsulation ensures that classes can be designed so that if a method has an argument MyType x, any subclass of MyType can be passed to that method. Save Question Show Answer Discussion 0 Clear Discussion Most voted Newest No comments yet. Be the first to comment. Post Be respectful. No spam. Correct Answer: A
Question 14 Q: 14 Which three statements describe the object-oriented features of the Java language? (Choose three.) Options A: Objects cannot be reused. B: A subclass must override the methods from a superclass. C: Objects can share behaviors with other objects. D: A package must contain a main class. E: Object is the root class of all other objects. F: A main method must be declared in every class. Save Question Show Answer Discussion 0 Clear Discussion Most voted Newest No comments yet. Be the first to comment. Post Be respectful. No spam. Correct Answer: B,C,F Reference:
Question 15 Q: 15 Given the code fragments: Which code fragment, when inserted at line n1, enables the code to print Hank? Options A: Option A B: Option B C: Option C D: Option D Save Question Show Answer Discussion 0 Clear Discussion Most voted Newest No comments yet. Be the first to comment. Post Be respectful. No spam. Correct Answer: C
Question 16 Q: 16 Given the code fragment: What is the result? Options A: Sum is 600 B: Compilation fails at line n1. C: Compilation fails at line n2. D: A ClassCastException is thrown at line n1. E: A ClassCastException is thrown at line n2. Save Question Show Answer Discussion 0 Clear Discussion Most voted Newest No comments yet. Be the first to comment. Post Be respectful. No spam. Correct Answer: C
Question 17 Q: 17 Given the following code: What is the output? Options A: 44 B: 35 C: 47 D: 54 E: 45 F: 421 Save Question Show Answer Discussion 0 Clear Discussion Most voted Newest No comments yet. Be the first to comment. Post Be respectful. No spam. Correct Answer: E
Question 18 Q: 18 Given the code fragment: What is the result? Options A: A B C Work done B: A B C D Work done C: A Work done D: Compilation fails Save Question Show Answer Discussion 0 Clear Discussion Most voted Newest No comments yet. Be the first to comment. Post Be respectful. No spam. Correct Answer: C
Question 19 Q: 19 Given: What is the result? Options A: 10:20 B: 0:20 C: Compilation fails at line n1 D: Compilation fails at line n2 Save Question Show Answer Discussion 0 Clear Discussion Most voted Newest No comments yet. Be the first to comment. Post Be respectful. No spam. Correct Answer: D
Question 20 Q: 20 Given the code fragment: What is the result? Options A: 1 2 3 4followed by an ArrayIndexOutOfBoundsException B: 1 2 3 C: 1 2 3 4 D: Compilation fails. Save Question Show Answer Discussion 0 Clear Discussion Most voted Newest No comments yet. Be the first to comment. Post Be respectful. No spam. Correct Answer: B