Oracle Certified Java Associate Exam Quiz!

60 Questions | Total Attempts: 39

SettingsSettingsSettings
Please wait...
Oracle Certified Java Associate Exam Quiz!

.


Questions and Answers
  • 1. 
    Follow the instructions in the image.
    • A. 

      Cars

    • B. 

      Cars carts

    • C. 

      Ccars arts

    • D. 

      The code does not compile.

    • E. 

      The code compiles but throws an exception at runtime.

  • 2. 
    Follow the instructions in the image.
    • A. 

      –,+,=,--

    • B. 

      %,*,/,+

    • C. 

      =,+,/,*

    • D. 

       ^,*,-,==

    • E. 

      *,/,%,--

  • 3. 
    Which of the following are valid JavaBean signatures?
    • A. 

      Public byte getNose(String nose)

    • B. 

      Public void setHead(int head)

    • C. 

      Public String getShoulders()

    • D. 

      Public long isMouth() 

    • E. 

      Public void gimmeEars()

    • F. 

      Public boolean isToes()

  • 4. 
    Follow the instructions in the image.
    • A. 

      One line needs to be changed for this code to compile.

    • B. 

      Two lines need to be changed for this code to compile.

    • C. 

      Three lines need to be changed for this code to compile.

    • D. 

      If the code is fixed to compile, none of the cells in the 2D array have a value of 0

    • E. 

      If the code is fixed to compile, half of the cells in the 2D array have a value of 0.

    • F. 

      If the code is fixed to compile, all of the cells in the 2D array have a value of 0.

  • 5. 
    Which of the following statements about java. lang. Error is most accurate?
    • A. 

      An Error should be thrown if a file system resource becomes temporarily unavailable.

    • B. 

      An application should never catch an Error.

    • C. 

      Error is a subclass of Exception, making it a checked exception.

    • D. 

      It is possible to catch and handle an Error thrown in an application.

    • E. 

      An Error should be thrown if a user enters invalid input.

  • 6. 
    Given a class that uses the following import statements, which class would be automatically accessible without using its full package name?  import forest.Bird; import jungle.tree.*; import savana.*;
    • A. 

      Forest.Bird

    • B. 

      Savana.sand.Wave

    • C. 

      Jungle.tree.Huicungo

    • D. 

      Java.lang.Object

    • E. 

      Forest.Sloth

    • F. 

      Forest.ape.bonobo

  • 7. 
    How many of the following variables represent immutable objects? ArrayList l = new ArrayList(); String s = new String(); StringBuilder sb = new StringBuilder(); LocalDateTime t = LocalDateTime.now();
    • A. 

      None

    • B. 

      One

    • C. 

      Two

    • D. 

      Three

    • E. 

      Four

    • F. 

      None of the above—this code doesn’t compile.

  • 8. 
    Follow the instructions in the image.
    • A. 

      Leaves growing

    • B. 

      Ing

    • C. 

      Wing

    • D. 

      The code does not compile

    • E. 

      The code compiles but throws an exception at runtime

  • 9. 
    Follow the instructions in the image.
    • A. 

      False false false

    • B. 

      True true true

    • C. 

      False true true

    • D. 

      False false true

    • E. 

      The code does not compile

  • 10. 
    Follow the instructions in the image.
    • A. 

      One

    • B. 

      Two

    • C. 

      Three

    • D. 

      Four

    • E. 

      Five

    • F. 

      None. The code does not compile.

  • 11. 
    Follow the instructions in the image.
    • A. 

      Lines 15 and 17

    • B. 

      Lines 15, 16, and 21

    • C. 

      Line 17

    • D. 

      Lines 17, 18, and 20

    • E. 

      Line 20

    • F. 

      Line 21

  • 12. 
    Which of the following do not compile when filling in the blank?  long bigNum = ____________;
    • A. 

      1234

    • B. 

      1234.0

    • C. 

      1234.0L

    • D. 

      1234l

    • E. 

      1234L

    • F. 

      1_234

  • 13. 
    Follow the instructions in the image.
    • A. 

      None

    • B. 

      One

    • C. 

      Two

    • D. 

      This is an infinite loop.

    • E. 

      The code does not compile.

  • 14. 
    Follow the instructions in the image.
    • A. 

      6

    • B. 

      X

    • C. 

      The code does not compile.

    • D. 

      The code compiles but throws a NullPointerException at runtime.

    • E. 

      The code compiles but throws a different exception at runtime.

    • F. 

      The output is not guaranteed.

  • 15. 
    Which of the following use generics and compile without warnings? (Choose two.)
    • A. 

      List<String> a = new ArrayList();

    • B. 

      List<> b = new ArrayList();

    • C. 

      List<String> c = new ArrayList<>();

    • D. 

      List<> d = new ArrayList<>();

    • E. 

      List<String> e = new ArrayList<String>(); F. List<> f = new ArrayList<String>();

    • F. 

      List<> f = new ArrayList<String>();

  • 16. 
    Which of the following are true right before the main() method ends? (Choose two.)
    • A. 

      No objects are eligible for garbage collection.

    • B. 

      One object is eligible for garbage collection.

    • C. 

      Two objects are eligible for garbage collection.

    • D. 

      No objects are guaranteed to be garbage collected

    • E. 

      One object is guaranteed to be garbage collected.

    • F. 

      Two objects are guaranteed to be garbage collected.

  • 17. 
    Follow the instructions in the image.
    • A. 

      None. The code compiles and prints swim!.

    • B. 

      None. The code compiles and prints a stack trace.

    • C. 

      One

    • D. 

      Two

    • E. 

      Three

  • 18. 
    Follow the instructions in the image.
    • A. 

      One

    • B. 

      Two

    • C. 

      Three

    • D. 

      None. It doesnt compile.

    • E. 

      None. It throws an exception at runtime.

  • 19. 
    Which keywords are required with a try statement? (CAREFUL) I. finalize II. catch III. throws IV. finally
    • A. 

      I Only

    • B. 

      II Only

    • C. 

      II only

    • D. 

      IV Only

    • E. 

      I or II, or both

    • F. 

      None of the above

  • 20. 
    Follow the instructions in the image.
    • A. 

      5

    • B. 

      7

    • C. 

      8

    • D. 

      The code does not compile.

    • E. 

      The code compiles but throws an exception at runtime.

  • 21. 
    Follow the instructions in the image.
    • A. 

      0 1

    • B. 

      1 1

    • C. 

      1 2

    • D. 

      The code does not compile.

    • E. 

      The code compiles but throws an exception at runtime.

  • 22. 
    Follow the instructions in the image.
    • A. 

      B

    • B. 

      Black

    • C. 

      Lack

    • D. 

      The code does not compile.

    • E. 

      The code compiles but throws an exception at runtime.

  • 23. 
    Which modifiers can be independently applied to an interface method? (Choose three.)
    • A. 

      Default

    • B. 

      Protected

    • C. 

      Static

    • D. 

      Private

    • E. 

      Final

    • F. 

      Abstract

  • 24. 
    Follow the instructions in the image.
    • A. 

      Null

    • B. 

      Shoelace

    • C. 

      Shoelaceshoelace

    • D. 

      The code does not compile

    • E. 

      This is an infinite loop

    • F. 

      The code compiles but throws an exception at runtime.

  • 25. 
    What statements are true about compiling a Java class file? (Choose two.)
    • A. 

      If the file does not contain a package statement, then the compiler considers the classpart of the java.lang package.

    • B. 

      The compiler assumes every class implicitly imports the java.lang.* package

    • C. 

      The compiler assumes every class implicitly imports the java.util.* package.

    • D. 

      Java requires every file to declare a package statement

    • E. 

      Java requires every file to declare at least one import statement

    • F. 

      If the class declaration does not extend another class, then it implicitly extends the java.lang.Object class.

Back to Top Back to top