• Skip to main content
  • Skip to primary sidebar

Founder at work

Master the skills to create and launch your next SaaS company

  • About Me
  • Reviews
  • Resources
  • Community
  • Contact
  • Lessons
  • Series
  • Search
  • Login

What are legal variable names in java

September 9, 2012 by Rick Hernandez Leave a Comment

Variable names are case-sensitive. A variable’s name can be any legal identifier — an unlimited-length letters and digits, beginning with a letter, the dollar sign “$”, or the underscore character ““. The convention, however, is to always begin your variable names with a letter, not “$” or ““. Additionally, the dollar sign character, by convention, is never used at all. Try to avoid the “$”, “_” because they are technically legal to begin your variable’s name with this is discourages could cause big headache when trying to debug. White space are not permitted.

 
Try an used variable names that are clear and easy to understand relating to the program. a bad example would be X, Y, and Z. something more useful would be CleanCoat, DirtyCoat, something that describes the variable name for easier maintenance in the feature and make your code read like a novel.

If the name you choose consists of only one word, spell that word in all lowercase letters. If it consists of more than one word, capitalize the first letter of each subsequent word.

Rick Hernandez

I always had a passion for the field of STEM (Science, Technology, Engineering, and Math) and I knew I wanted to do something to make a difference in the world. I just didn’t know where to start. I was an immigrant in a new country, grew up in a tough environment, and wasn’t sure how… Read More

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)

Related

Filed Under: Java, Programming

Primary Sidebar

Learn How To Take Your Idea And Convert It Into An App From Scratch Even If You Have Never Written A Single Line Of Code.

  • How to Find Your Next Great App Idea
  • The Secret To Getting PAID To Build Your Own App
  • How To Create Your App (SaaS, Mobile, VR, AR, Game)
  • How To Monetize Your Apps
Learn More
4.82 Ratings

Copyright © 2025 · JSecademy Blog Theme on Genesis Framework · WordPress · Log in