GoConqr has a new look! Let us know what you think.

Quiz

OCAJP8 Chapter 1

Muhammad Khoiruddin Harahap 50 questions

Take the quiz

This quiz has a time limit, so it opens in the usual player.

Questions in this quiz (50)

  1. 1Given the code fragment
    Image for question 1
    1. A200.0 : 100.0
    2. B400.0 : 200.0
    3. C400.0 : 100.0
    4. DCompilation fails
  2. 2given FragmentImage for question 2
    1. A10 Hello World!
    2. BHello Universe!
    3. CHello World!
    4. DCompilation fails.
  3. 3Given the code fragment:
    What is the result?
    Image for question 3
    1. ASum is 600
    2. BCompilation fails at line n1.
    3. CCompilation fails at line n2.
    4. DA ClassCastException is thrown at line n1.
    5. EA ClassCastException is thrown at line n2.
  4. 4Given the code fragment:Image for question 4
    1. AAn exception is thrown at runtime.
    2. B2
    3. C5
    4. D0
  5. 5Given the code fragment:Image for question 5
    1. AMatch 1
    2. BMatch 2
    3. CNo Match
    4. DA NullPointerException is thrown at runtime.
  6. 6Given : Image for question 6
    1. AA B C D
    2. BA C D
    3. CA B C C
    4. DA B D
    5. EA B D C
  7. 7Which code fragment should you use at line n1 to instantiate the dvd object successfully?Image for question 7
    1. AOption AImage for option A
    2. BOption AImage for option B
    3. COption CImage for option C
    4. DOption DImage for option D
  8. 8Which option can replace xxx to enable the code to print 135?Image for question 8
    1. Aint e = 0; e < = 4; e++
    2. Bint e = 0; e < 5; e + = 2
    3. Cint e = 1; e < = 5; e + = 1
    4. Dint e = 1; e < 5; e+ =2
  9. 9Which statement best describes encapsulation?
    1. AEncapsulation ensures that classes can be designed so that only certain fields and methods of an
      object are accessible from other objects.
    2. BEncapsulation ensures that classes can be designed so that their methods are inheritable.
    3. CEncapsulation ensures that classes can be designed with some fields and methods declared as
      abstract.
    4. DEncapsulation 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.
  10. 10Which code fragment, when inserted at line 2, enables the code to compile?
    Image for question 10
    1. AOption AImage for option A
    2. BOption BImage for option B
    3. COption CImage for option C
    4. DOption DImage for option D
    5. EOption EImage for option E

Information

Description
Quiz on OCAJP8 Chapter 1, created by Muhammad Khoiruddin Harahap on 21/11/2017.
Language
English
Views
26
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?