Copyright

Java: Final Keyword

Instructions:

Choose an answer and hit 'next'. You will receive your score and answers at the end.

question 1 of 3

Examine the following code. What is wrong?

Create Your Account To Take This Quiz

As a member, you'll also get unlimited access to over 79,000 lessons in math, English, science, history, and more. Plus, get practice tests, quizzes, and personalized coaching to help you succeed.

Try it risk-free
Try it risk-free for 30 days. Cancel anytime
Already registered? Log in here for access

1. When used to create a class, the final keyword will prevent the creation of _____

2. Examine the following code. Which variable cannot be re-initialized or assigned a new value?

Create your account to access this entire worksheet
A Premium account gives you access to all lesson, practice exams, quizzes & worksheets
Access to all video lessons
Quizzes, practice exams & worksheets
Certificate of Completion
Access to instructors
Create an account to get started Create Account

About This Quiz & Worksheet

This quiz/worksheet combo quickly and effectively tests your knowledge of the use of final in Java. You will be tested on your ability to read Java syntax to recognize final as well as your understanding of its function.

Quiz & Worksheet Goals

In this assessment you'll measure your understanding of major points like:

  • What the final keyword prevents when used to create a class
  • How your code will compile if you try to create a subclass from a final class
  • What final can be used to protect

Skills Practiced

  • Problem solving - use acquired knowledge to read Java code and describe what will happen if it were to be compiled
  • Information recall - access the knowledge you've gained regarding what will happen if you try to re-initialize a final variable
  • Knowledge application - use your knowledge to answer questions about what final keywords do in Java and how they protect code

Additional Learning

Learn more about this Java command using the lesson titled Java: Final Keyword. You will explore concepts like:

  • What a subclass is
  • Why final offers security in Java
  • How final prevents String from being used in a negative way
Support