Jump to content

Literal (computer programming)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Chris Q (talk | contribs) at 10:14, 19 May 2005 (please verify that this is what is meant!!). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Object literal (appears to refer to) an expression of data that can be used to create an instance of an object in the declaration. For example, in Java

String[] animals = new String[] {"cat", "dog"};

is an object literal declaration, as opposed to the nol-literal declaration

String[] animals = new String[2];
animals[0] = "cat";
animals[1] = "dog";