BookRags.com Literature Guides Literature
Guides
Criticism & Essays Criticism &
Essays
Questions & Answers Questions &
Answers
Lesson Plans Lesson
Plans
My Bibliography Periodic Table U.S. Presidents Shakespeare Sonnet Shake-Up
Research Anything:        
History | Encyclopedias | Films | News | Create a Bibliography | More... Login | Register | Help

Reserved word

Print-Friendly
About 1 pages (322 words)
Reserved word Summary

Bookmark and Share

In computer programming languages, a reserved word is a word which has a special grammatical meaning to a language and cannot be used as an identifier in that language. For instance, in SQL, a user cannot be called "group" because the word group is used to indicate that an identifier refers to a group, not a user. Such a word is a keyword; it is because its use is restricted that it is also a reserved word. Sometimes the specification for a programming language will have reserved words that are intended for possible use in future versions. In Java, const and goto are reserved words — they have no meaning in Java but they also cannot be used as identifiers. By "reserving" the terms, they can be implemented in future versions of Java, if desired, without "breaking" older Java source code.

Reserved words and language independence

(See also: Language-independent_specification) In .NET's Common Language Specification, all languages must provide a mechanism for using public identifiers that are reserved words in that language. To see why this is necessary, suppose we defined a class in VB.NET as follows:

Public Class this
End Class

Then, we compile this class into an assembly and distribute it as part of a toolbox. A C# programmer, wishing to define a variable of type “this” would encounter a problem: “this” is a reserved word in C#. The following will not compile in C#:

this x = new this();

A similar issue arises when accessing members, overriding virtual methods, and identifying namespaces. In C#, placing the at-sign before the identifier, will force it to be considered an identifier rather than a reserved word by the compiler. The at-sign is not considered part of the identifier.

@this x = new @this();

For consistency, this usage is also permitted in non-public settings such as local variables, parameter names, and private members.

View More Summaries on Reserved word
More Information
  • View Reserved word Study Pack
  • Search Results for "Reserved word"
  • Add This to Your Bibliography
  • More Products on This Subject
    Reserved Word
    A reserved word is a word or symbol that has a special meaning, specific to or part of a particular programming language or a specific program. Reserved or restricted keywords are used to control how that program is defined. Programs are simply a set of... more


     
    Copyrights
    Reserved word from Wíkipedia. ©2006 by Wíkipedia. Licensed under the GNU Free Documentation License. View a list of authors or edit this article.

    Article Navigation
    Join BookRagslearn moreJoin BookRags




    About BookRags | Customer Service | Report an Error | Terms of Use | Privacy Policy