Java Keywords: Protected, Public & Private


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

question 1 of 3

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

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. Which type of variable or method can ONLY be used within the current package?

2. Examine the following code. What is true about the variables and methods within the class NYCustomer?

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 will help you measure your knowledge of important Java concepts. You will differentiate between using protected, public and private to describe variables in Java.

Quiz & Worksheet Goals

In this set of questions, you'll test your understanding of:

  • How most variables should be created
  • What variable is used within the current package
  • Where a program would use the variable fte in a given code series
  • If a given line of code would work

Skills Practiced

  • Problem solving - use acquired knowledge to describe variables within a specific piece of Java code
  • Information recall - access the knowledge you've gained regarding the status that most variables should be created under
  • Knowledge application - use your knowledge to answer questions about the correct and incorrect syntax in Java code

Additional Learning

To find out more about these aspects of Java, review the lesson titled Java Keywords: Protected, Public & Private. You will explore concepts like:

  • The level of restriction in these keywords
  • Examples of classes and subclasses
  • Common variables used in different classes