CMPUT101 Lecture Notes - Lecture 4: Dollar Sign
Document Summary
Cmput 114 lecture 4 references: literals, variables and. In a written program, we can"t draw shapes so we need to have some notation for referring to objects and values called a reference. There are different ways to reference objects & values in a. The simplest way is to use a literal in our code. A literal refers to the same object or value at all times. You can think of a literal as a nameplate that is automatically pre-bound to an object or value. In general, a literal is recognized by the compiler and is immediately translated into a language value or object. Common literals in programming languages include characters, numbers, and strings. Some objects cannot be referred to using literals. Sometimes we may want to rebind our nameplates. A variable is like a soft nameplate that may be attached to an object or value and may be re-attached to a different object or value in the future.