Language Logic
Contents
Objects
Objects in any programming language are sections of memory in a computer that store data.
Variables
Variables are objects that store data, and are given names, values and sometimes object types. The purpose of variables, are to store data for later use in a program. To do this, the computer's processor takes up a part of its memory and remembers the data you put into the variable.
Examples | |||
---|---|---|---|
Language | Type | Name | Value |
C | const char* | name | = "value"; |
JAVA | final String | Name | = "Value"; |
C# | const string | VariableName | = "SomeValue"; |
Pointers
Pointers are created to "point" to parts of the computer's memory and keep track of an object in memory. When a variable is created in one part of a program, and used in a different part, it is common for a pointer to be used in its place; This way, a new variable doesn't have to be created, and less memory is used.
Referencing
Pointers are references to an object's memory location - which store an object's data. Pointers can change the value of the object it is pointing to, and can keep an updated value from the object.
De-referencing
When an object is de-referenced, the original object still retains its data, but the pointer becomes empty, and retains a null(empty) value.
Collections
Collections are groups of objects that share an object type, and can be managed as a group.