What is the difference between a keyword and a user defined identifier




















This content further elaborates the difference between a keyword and an identifier. Identifiers are the user defined names of variable, function and labels. Identify the name of a particular entity. Format Consider only letters. Consider letters, underscore, digits.

Case Use only lowercase. Lower and upper cases, both are allowed. Symbol No special symbol, punctuation is used. No punctuation or special symbol except 'underscore' is used. Classification Keywords are not further classified. There is also a set of words provided by the programming language having specific meanings. They are known as keywords.

Keywords belong to the language, and each have particular tasks. These keywords cannot be used as identifier names. This article discusses the difference between an identifier and a keyword.

The key difference between identifier and keyword is that, an identifier is a user defines name for variable, function, class while a keyword is a reserved word provided by the programming language.

Overview and Key Difference 2. What is an Identifier 3. What is a Keyword 4. Similarities Between Identifier and Keyword 5. A name created by the programmer to define a variable, function or class is known as an identifier. The identifiers are used to identify these entities uniquely. It is important to give meaningful names to the identifiers to make the code easily readable.

It will also help other programmers to identify what the program is about. There are certain rules when creating identifiers. Identifiers are permitted only to use alphabetical characters, digits and underscore. It is not recommended to start an identifier with a digit. Most programming languages support case sensitivity. When creating a class, the programmer can use a meaning identifier that describes the attributes and methods. Likewise, the programmer can create identifiers according to the program.

Once declared, you can use the identifier in later program statements to refer to the associated value. A special kind of identifier, called a statement label, can be used in goto statements.

Attention reader! All those who say programming isn't for kids, just haven't met the right mentors yet. The students will get to learn more about the world of programming in these free classes which will definitely help them in making a wise career choice in the future. Next Designing models in Cassandra. Recommended Articles.

Article Contributed By :. Easy Normal Medium Hard Expert.



0コメント

  • 1000 / 1000