Copyright

Working with Java Chapter Exam

Exam Instructions:

Choose your answers to the questions and click 'Next' to see the next set of questions. You can skip questions if you would like and come back to them later with the yellow "Go To First Skipped Question" button. When you have completed the practice exam, a green submit button will appear. Click it to see your results. Good luck!

Page 1

Question 1 1. Which of the following describes the value GRAY in the code below?

Question 2 2. What is missing from the following code?

Question 3 3. Consider the code segment below. What values can priceCategory take on?

Question 4 4. Consider the code segment below. What will the change be in revenue if firstClassPassengerCount is 25 and priceCategory is 1?

Question 5 5. Examine the following code. What will the result of be?

Page 2

Question 6 6. Examine the following code. What will happen if a string literal 'butterfly' exists in the string constant pool?

Question 7 7. Which of the following is NOT an original use for Java?

Question 8 8. When you don't want a method to be dependent on an object instance, you use what keyword?

Question 9 9. What is a risk of using reflection?

Question 10 10. Which of the following retrieves the class name from the instance of the Testing class?

Page 3

Question 11 11. What is missing from the following code?

Question 12 12. What happens when you add an item to an existing ArrayList, without specifying an index?

Question 13 13. What will display after this code runs?

Question 14 14. What will Java display after the following code is run?

Question 15 15. Why is the maximum value of an integer one less than the minimum?

Page 4

Question 16 16. Examine the following code. What should be added to the if statement?

Question 17 17. Examine the code below and choose which option will correctly retrieve the declared fields for the referenced class.

Question 18 18. When using reflection in your code, which of the following should be used to help mitigate frustration?

Question 19 19. What would happen if you tried to use parseInt on an integer value that was out of range (such as 9542254568) in Java?

Question 20 20. Based on the Java code below, which of the item(s) in the array coolString would pass the Integer test, therefore parseInt would be successful?

Page 5

Question 21 21. Java instanceof keyword is...

Question 22 22. Instanceof returns _____ if the value of the object is null.

Question 23 23. Based on the following Sets and the Iterator method, what will be the first value to display on the screen after the code runs?

Question 24 24. Based on the following snippet of a Set, which of the following declarations would sort it in ascending order?

Question 25 25. If it is possible that a get method will try to reach a non-existent index, what should you do?

Page 6

Question 26 26. The following code contains an error. What needs to be updated to correct the issue?

Question 27 27. Which option is a correct usage of pi in Java?

Question 28 28. Which of the following is a valid use of the PI constant in Java?

Question 29 29. In the following code, which is the following is the hexadecimal representation of the color?

Question 30 30. The statement Math.random() will generate what type of values?

Working with Java Chapter Exam Instructions

Choose your answers to the questions and click 'Next' to see the next set of questions. You can skip questions if you would like and come back to them later with the yellow "Go To First Skipped Question" button. When you have completed the practice exam, a green submit button will appear. Click it to see your results. Good luck!

Information Systems: Help and Review  /  Business Courses
Support