Question

Why are the following valid Java identifiers not considered good identifiers? a. q, b. totVal, c. theNextValuelnTheList.

Solution

Verified

Step 1

1 of 2

To\textbf{To} be a good java identifiers, identifiers should be descriptive. The name should have some meaning.

Case a. q     \implies this 'q' identifier does not refer to any meaningful work although it is very short.

Case b. totVal     \implies this 'totVal' is short but still does not exactly tell the user what this identifier represents.

Case c. theNextValueInTheList     \implies this 'theNextValueInTheList' is very long. So this also considered not a good identifier.

Create an account to view solutions

By signing up, you accept Quizlet's Terms of Service and Privacy Policy
Continue with GoogleContinue with Facebook

Create an account to view solutions

By signing up, you accept Quizlet's Terms of Service and Privacy Policy
Continue with GoogleContinue with Facebook

Recommended textbook solutions

Java Software Solutions for AP Computer Science 3rd Edition by Cara Cocking, John Lewis, William Loftus

Java Software Solutions for AP Computer Science

3rd EditionCara Cocking, John Lewis, William Loftus
499 solutions
Java Methods: Object-Oriented Programming and Data Structures 3rd Edition by Gary Litvin, Maria Litvin

Java Methods: Object-Oriented Programming and Data Structures

3rd EditionGary Litvin, Maria Litvin
285 solutions

Related questions