Posts

Showing posts with the label Identifiers

Identifiers

Image
What is identifier. A Name in Java program is called identifier, which can be used for identification purpose. It can be a class name, interface name, method name, label name, variable name etc. Example In the above example words marked with red underline are identifiers. As you can see there are 5 identifiers Test (Class Name) main (Method Name) String (Pre-defined Class Name) args (Variable Name) println(Method Name) Rules / Convention for Identifier Naming While defining Java identifier name, we have to follow some rules as listed below. Allowed characters in Java identifier are listed below.  A to Z (Uppercase letters) a to z (Lowercase letters) 0 to 9 (Digits) _ (Underscore) $ (Dollar sign) Example:  contact_number ( ✓ ) contact#   (✕) Identifier can't starts with digit. Example abc123 ( ✓ ) 123abc (✕) Java is a case sensitive language all variable listed below are different, but it is not a good programming

Popular posts from this blog

String in golang

Inline V/S Block Level Element

Floating point Data types in Go lang

Escape Sequence | Formatted Printing | Interview Questions

Sum of two numbers

Operators in C Language| Part-4

Printing in C programming

Arrays in C Language

Program to check a year is leap year or not.

Data types in Java