Copyright
Java Programming Tutorial & Training  /  Business Courses

Test Prep Plan - Take a practice test

Take this practice test to check your existing knowledge of the course material. We'll review your answers and create a Test Prep Plan for you based on your results.
How Test Prep Plans work
1
Answer 50 questions
Test your existing knowledge.
2
View your test results
Based on your results, we'll create a customized Test Prep Plan just for you!
3
Study smarter
Study more effectively: skip concepts you already know and focus on what you still need to learn.

Variables & Operators in 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. To declare a constant, the Java keyword _____ is used.

Question 2 2. What will be displayed when this Java code is executed?

Question 3 3. Which of the following correctly defines the class Client so that it can be serialized/use transient variables?

Question 4 4. In order to serialize, we need to make use of the _____ utility.

Question 5 5. Final can be used to protect the following:

Page 2

Question 6 6. Trying to create a subclass from a final class, or re-initialize a final variable, will result in what?

Question 7 7. Examine the following code. What relational operators are being used?

Question 8 8. Examine the following code. What relational operator is being used?

Question 9 9. The following code will _____ the variable i by 1.

Question 10 10. What will the value of y be after this code completes?

Page 3

Question 11 11. Which of the following is true about constant naming conventions in Java?

Question 12 12. A constant in Java is declared with the identifier 'LAST_NAME'. Which of the following is an alternate name for this constant?

Question 13 13. Examine the following code. Which answer best describes the scope issue with the variable i in the final line of code?

Question 14 14. The following code is giving a warning about the variable bean counter. What should be done to resolve the issue?

Question 15 15. Which of the following correctly imports the Java utility for atomic variables?

Page 4

Question 16 16. Consider the following: Thread 1 is accessing a variable and will not allow updates. Thread 2 cannot access the variable because it is _____

Question 17 17. When multiplying and/or dividing large, complex numbers, which data type is best?

Question 18 18. What are these two symbols for: / and %.

Question 19 19. Which of the following shows a statement using the AND logical operator?

Question 20 20. Which of the following uses a standard OR statement?

Page 5

Question 21 21. Examine the following code. Where can the program use the variable fte?

Question 22 22. The following code creates a subclass of Customer. Will the last line of code work?

Question 23 23. Atomic variables are called _____

Question 24 24. Examine the following code. What is happening to the variable counter?

Question 25 25. Suppose you want to store information about all the bicycles in a bike shop. What type of variable would you use to store the amount of speeds each bike has?

Page 6

Question 26 26. What type of variable is 'shiftLength' in the following code?

Question 27 27. Which type of bitwise operation is the being performed?

Question 28 28. A bitwise XOR places a 1 in the bit position if:

Question 29 29. What is assigned to a variable that is declared as a reference to a Java object, when no reference is explicitly specified in the declaration?

Question 30 30. Examine the following code. Which variable should be changed to transient?

Variables & Operators in 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!

Support