J ava reserved words and naming conventions
  
 Introduction

Every programming language has its own set of rules and conventions for the kinds of names that you're allowed to use, and the Java programming language is no different. The rules and conventions for naming your variables can be summarized as follows:

  • Variable names are case-sensitive.
  • Subsequent characters may be letters, digits, dollar signs, or underscore characters.
  • 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.
Your Ad Here

 
 Java reserved words:

abstractdefaultifpackagethis
booleandoimplementsprivatethrow
Breakdoubleimportprotectedthrows
Byteelseinstanceofpublictransient
caseextendsintreturnnull
tryConstfornewswitch
continuewhilegotosynchronizedsuper
Catchfinalinterfaceshortvoid
charfinallylongstaticvolatile
classfloatnative


 Java naming conventions:

Variable Names:
Can start with a letter, ‘$’ (dollar symbol), or ‘_’ (underscore); cannot start with a number; cannot be a reserved word.

Method Names:
Verbs or verb phrases with first letter in lowercase, and the first letter of subsequent words capitalized; cannot be reserved words.
Example: setColor()

Class And Interface Names:
Descriptive names that begin with a capital letter, by convention; cannot be a reserved word.

Constant Names:
They are in capitals.
Example: Font.BOLD, Font.ITALIC

 Click for Next Quick Reference
PreviousNext



Your Ad Here


 About Author
Author Name           : Mr. R.Franklin Bourgia Singh
Country                    : INDIA
Working In               : Aryans Infoway (P) Ltd.
Email                        : admin@completetutorials.co.cc
Author Home Page : http://www.completetutorials.googlepages.com
 Reach me!
   My Web URL : http://www.completetutorials.googlepages.com
   If you like this article and/or code, make a small donation to my account,
Till we meet next time BYE     

  Send your feed-back and query to admin@completetutorials.co.cc
©2008 Bourgia